thymeleaf在开发环境正常,但用jar运行时报错

环境:springboot 1.5.2,thymeleaf

情况:在开发环境下正常,但使用jar运行时,报错Error resolving template template might not exist or might not be accessible,意思是模板页不在,但在jar里存在该模板页


至尊宝的传说
浏览 967回答 2
2回答

qq_花开花谢_0

原因是指向模板的路径前有斜杆/,就会出错,去掉就正常了(路径前不能带斜杆,类似相对路径的写法)网上有人说增加配置spring.thymeleaf.prefix=classpath:/templates也能解决

波斯汪

怎么解决的呀
打开App,查看更多内容
随时随地看视频慕课网APP