Springboot 的properties文件配置

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值