关于springboot:Spring-Boot-项目基础入门

spring boot 我的项目根底入门

实现Goods我的项目的增删改查

1)创立spring starter boot 我的项目
2)增加依赖:jdbc,mysql,spring,mybatis,thymeleaf
3)批改我的项目的application.properties文件

配置端口号(能够在浏览器拜访时不写端口号)
server.port=80(80端口号在拜访时能够省略)
配置spring boot 与数据库的连贯
spring.datasource.url
spring.datasource.username
spring.datasource.password
配置mybatis.mapper-location=classpath:/templates/pages/
配置classpath:/mapper/*/*.xml
配置.html

4)创立pojo对象
5)创立数据层接口

用@Mapper形容该接口
这里写映射(既增删改查的SQL语句及办法)

6)创立业务层接口

这里写业务办法

7)创立业务层的实现类

用@Service形容该类
这里重写业务层接口的所有形象办法

8)创立Controller类

这里调用业务层实现类的办法做增删改查

9)创立html,获取相应的数据及在页面上显示

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理