首页 > 编程语言 > 详细

springboot 1.5.2 thymeleaf 添加templates 静态资源访问路径

时间:2017-03-23 23:32:15      阅读:1956      评论:0      收藏:0      [点我收藏+]

从velocity 模板切换到thymeleaf 后, 默认模板位置为templates , 有时候静态资源方在该目录下会出现访问404错误

 

解决办法:

application.properties 中添加:

spring.mvc.static-path-pattern=/**
spring.resources.static-locations=classpath:/templates/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/

 

springboot 1.5.2 thymeleaf 添加templates 静态资源访问路径

原文:http://www.cnblogs.com/xiaojf/p/6607922.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!