如何设置前缀路径(设置新目录)来渲染 HTML 页面?
我有一个春季启动应用程序。我使用的是2.1.7版本。
小智 6
在 Application.properties 中添加以下行
spring.thymeleaf.check-template-location=true
spring.thymeleaf.prefix=classpath:/templates/views/ #this is the main
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.servlet.content-type=text/html
spring.thymeleaf.cache=false
spring.main.allow-bean-definition-overriding=true
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5493 次 |
最近记录: |