分享一下搭建框架的心得,有什么不对的地方欢饮大家指正。
@EnableTransactionManagement注释使用事务,需要在service方法上添加注解@Transaction
下面是log的配置:
spring.thymeleaf.cache=false
spring.profiles.active=dev
#
server.servlet.session.timeout:3600
server.port=8181
#
logging.level.com.keying.dao=DEBUG
#mybatis
mybatis.config-location=classpath:config/mybatis-conf.xml
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.type-aliases-package=com.keying.po
#mybatis.configuration.map-underscore-to-camel-case=true
spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=xxxxx
spring.datasource.password=xxxxx
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.initial-size=5
spring.datasource.druid.max-active=100
spring.datasource.druid.min-idle=5
spring.datasource.druid.max-wait=60000
spring.datasource.druid.default-auto-commit=true
spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
spring.datasource.druid.validation-query-timeout=60000
spring.datasource.druid.test-on-borrow=false
spring.datasource.druid.test-on-return=false
spring.datasource.druid.test-while-idle=true
spring.datasource.druid.time-between-eviction-runs-millis=60000
spring.datasource.druid.min-evictable-idle-time-millis=300000
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
接口里写一个跳转:
上面配置完之后就完成了,大家没有成功的可以找我,直接去main方法里面运动就可以进入html页面了。有什么不对的地方大家可以指正出来,这个还不能热部署,我正在查找原因。成功执行后的页面应该是这样: