ssm+spring+mybatis实战

小组成员:

龙继平201731062131

王阳:201731041215

1、我采用springboot做项目。因为springboot继承ssm。更加容易,不容易出现配置问题。

2、在idea中新建一个springboot项目。

3、application.properties中配置环境。

server.port=8080
spring.datasource.url=jdbc:mysql://localhost:3306/javaee?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#配置视图解析
spring.mvc.view.prefix=/templates/
spring.mvc.view.suffix=.html
server.error.path=/error.html
#启用缓存
spring.thymeleaf.cache=true
#开启热部署
spring.devtools.restart.enabled=true
#监听目录
spring.devtools.restart.additional-paths=src/main/java
#配置mybatis
mybatis.mapper-locations=classpath:Mybatis/mapper/*.xml
mybatis.config-location=classpath:Mybatis/Mybatis-config.xml
mybatis.type-aliases-package=com.example.demo.entity

 4、在启动类上面配置mybatis的mapper扫描。和过滤器扫描

5、对代码进行修改。改bug。

6、由于我们小组原来项目就是采用的springboot整合ssm开发的,整合过程我就不详细写了。开发过程见以下博文

https://www.cnblogs.com/l123456l/p/13167637.html

https://www.cnblogs.com/l123456l/p/13086735.html

https://www.cnblogs.com/l123456l/p/12971506.html

 7、github地址:

https://github.com/JPL1988/demo

猜你喜欢

转载自www.cnblogs.com/l123456l/p/13167747.html
今日推荐