码迷,mamicode.com
首页 > 数据库 > 详细

thymeleaf在开发环境正常,但用jar运行时报错 Error resolving template template might not exist or might not be accessible

时间:2019-09-12 00:22:19      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:erro   原因   就会   写法   解决   pre   err   报错   exist   

 

通过打包 jar直接运行的

百度搜索此关键词找到的:“springboot jar error resolving template”

 

原因是指向模板的路径前有斜杆/,就会出错,去掉就正常了(路径前不能带斜杆,类似相对路径的写法)

网上有人说增加配置spring.thymeleaf.prefix=classpath:/templates也能解决

 

thymeleaf在开发环境正常,但用jar运行时报错 Error resolving template template might not exist or might not be accessible

标签:erro   原因   就会   写法   解决   pre   err   报错   exist   

原文地址:https://www.cnblogs.com/kinome/p/11509248.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!