spring boot 使用thymeleaf3.0以及thymeleaf的热部署


spring boot 截止1.5.4,默认使用thymeleaf2.0,会有一些很蛋疼的地方比如xml格式之类的,具体哪些就不说了

 -> 替换为3.0版本  

pom中加入

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- set thymeleaf version -->
<thymeleaf.version>3.0.0.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.0.0</thymeleaf-layout-dialect.version>
</properties>


thymeleaf热部署问题
  很简单:
1.配置文件中加上 spring.thymeleaf.cache=false
2.如果你用的是idea,那么编辑完html后使用ctrl + shift + F9 rebuild module一下就行了,其他的编辑器我就不知道了,还是推荐用IDEA


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM