当前位置:首页 > 数据库 > 正文

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

2020-03-02 数据库

 

通过打包 jar直接运行的

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

 

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

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

 

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/25340.html