SpringBoot使用Thymeleaf打成jar包部署找不到页面
使用SpringBoot+Thymeleaf时,在IDEA中运行正常,但打成Jar包运行时,报错:
1 | org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/wx/auth], template might not exist or might not be accessible by any of the configured Template Resolvers |
解决方案:
- 1.确认模板文件是否在templates文件夹里
- 2.返回路径”/wx/auth”这样写是不对的,要把斜杠去掉”wx/auth”