spring boot 下 thymeleaf 配置

thymeleaf 配置參數


關閉thymeleaf緩存 開發時使用 不然沒有實時畫面
spring.thymeleaf.cache=false

檢查模板是否存在,而後再呈現
spring.thymeleaf.check-template-location=true

Content-Type值
spring.thymeleaf.content-type=text/html

啓用MVC Thymeleaf視圖分辨率
spring.thymeleaf.enabled=true

應該從解決方案中排除的視圖名稱的逗號分隔列表
spring.thymeleaf.excluded-view-names=

模板編碼
spring.thymeleaf.mode=LEGACYHTML5

預先查看名稱的前綴
spring.thymeleaf.prefix=classpath:/templates/

附加查看名稱的後綴.
spring.thymeleaf.suffix=.html

中模板解析器的順序
spring.thymeleaf.template-resolver-order=

名稱的逗號分隔列表
spring.thymeleaf.view-names=

結尾必定要有 #thymeleaf end 不然掉坑
thymeleaf end
相關文章
相關標籤/搜索