SpringBoot 中使用 thymeleaf 在application.properties 中遇到的问题

spring.thymeleaf.content-type=text/html
server.context-path=/thymeleaf

报错,说此方法已经过时

原因:SpringBoot 2.0 版本之后进行了一些修改

解决方案:改为

spring.thymeleaf.servlet.content-type=text/html
server.servlet.context-path=/thymeleaf

即可

猜你喜欢

转载自blog.csdn.net/qq_33378853/article/details/87695723
今日推荐