springboot集成themeleaf问题

本文介绍了SpringBoot集成Thymeleaf时遇到的过时配置问题,如将'spring.thymeleaf.content-type=text/html'替换为'spring.thymeleaf.servlet.content-type=text/html'。同时,解决Thymeleaf页面修改后需重启服务器才能生效的问题,通过设置不使用缓存和调整IDE设置实现实时刷新。此外,还提到了PageRequest的过时用法和获取当前日期的方法。
摘要由CSDN通过智能技术生成
  1. Deprecated configuration property 'spring.thymeleaf.content-type'
    spring.thymeleaf.content-type=text/html已过时,
    改成:
    spring.thymeleaf.servlet.content-type=text/html

  2. springboot集成themeleaf报Namespace 'th' is not bound
     在html标签中加入命名空间

    <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
  3. 每一次我们对页面的修改都不能得到及时的反应,我们需要不断的重启服务器以看到效果,这在实际开发过程中是十分糟糕的表现,我们需要做一些修改,让Thymeleaf页面能够实时的刷新而不需要重启服务器。摘自:https://www.cnblogs.com/wmyskxz/p/10208648.html                                                               file→setting→Build...→compiler→√Build Project automatically 点击“OK”,                                                                        然后ctr+shift+alt+/ ,跳出Maintenance,选择Registry,√compiler...running,               配置application.properties                                                   
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值