Spring boot 如何在spring boot中为thymeleaf设置前缀路径
如何设置前缀路径(设置新目录)以呈现HTML页面 我有一个spring启动应用程序。我使用的是2.1.7版Spring boot 如何在spring boot中为thymeleaf设置前缀路径,spring-boot,Spring Boot,如何设置前缀路径(设置新目录)以呈现HTML页面 我有一个spring启动应用程序。我使用的是2.1.7版 我被设置为查看页面的新路径 在Application.properties中添加以下行 spring.thymeleaf.check-template-location=true spring.thymeleaf.prefix=classpath:/templates/views/ #this is the main spring.thymeleaf.suffix=.html sp
- 我被设置为查看页面的新路径李>
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
您可以使用基本设置,也可以通过覆盖application.properties中的属性来提供自己的自定义页面 一个前缀,用于在生成URL时查看名称
spring.thymeleaf.prefix=classpath:/config/templates/
在Application.properties“spring.thymeleaf.prefix=classpath:/templates/views/”中添加以下行