server.port=8080 server.session.timeout=1000 #配置数据库链接 spring.datasource.url=jdbc:mysql://localhost:3306/easycommunity?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 spring.datasource.username=root spring.datasource.password=password spring.datasource.driver-class-name=com.mysql.jdbc.Driver #暂用的druid,注意包的路径要写对 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource #前端引入静态包裹需要添加相关设置路径 #spring.mvc.static-path-pattern=/static/** spring.thymeleaf.static-path-pattern=file:src/main/resources/static/** # 定位模板的目录 #spring.mvc.view.prefix=classpath:/templates 因为是springboot项目而且我使用了thymeleaf,所以不能用 'mvc.view'!!! spring.thymeleaf.cache=false spring.thymeleaf.prefix=file:src/main/resources/templates/ # 给返回的页面添加后缀名 #spring.mvc.view.suffix=.html spring.thymeleaf.suffix=.html spring.thymeleaf.encoding=UTF-8 mybatis.mapper-locations=file:src/main/resources/mybatis/mapper/*Mapper.xml #关于xml文件和mybatis-config,有很多人写的是相对路径,但我用了相对路径,项目就找不到了,所以这里改成绝对路径,若有大佬知道原因,望指出,灰常感激 mybatis.config-location=file:src/main/resources/mybatis-config.xml #这一条可以在控制台打印sql语句输出 logging.level.src.main.java.com.klw.mapper=debug #扫描下方这个包,默认把这个路径下的class作为数据表的实体 mybatis.type-aliases-package=com.klw.domain debug=true
Springboot 的properties文件配置
最新推荐文章于 2024-04-17 07:27:02 发布