springboot配置freemaker模板和mysql数据源

配置文件都是在resources下的application.properties文件里面写的

 


server.port=8080
server.context.path=/

#配置数据库
spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT
spring.datasource.username=root
spring.datasource.password=1234
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver


#指定HttpServletRequest的属性是否可以覆盖controller的model的同名项
spring.freemarker.allow-request-override=false
#req访问request
spring.freemarker.request-context-attribute=req
#后缀名freemarker默认后缀为.ftl,当然你也可以改成自己习惯的.html
spring.freemarker.suffix=.ftl
#设置响应的内容类型
spring.freemarker.content-type=text/html;charset=utf-8
#是否允许mvc使用freemarker
spring.freemarker.enabled=true
#是否开启template caching
spring.freemarker.cache=false
#设定模板的加载路径,多个以逗号分隔,默认: [“classpath:/templates/”]
spring.freemarker.template-loader-path=classpath:/templates/
#设定Template的编码
spring.freemarker.charset=UTF-8
#数字格式化,无小数点
spring.freemarker.number_format=0.##

#打印mybatis的注解sql语句
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#使用xml写sql语句就需要加上这行注解,第一个xml为文件夹的名字
mybatis.mapper-locations=classpath:xml/*.xml

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值