您的位置:首页 > 其它

org.thymeleaf.exceptions.TemplateInputException的几种解决办法

2018-03-26 15:39 423 查看
异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成jar包部署到服务器上时,就一直报异常,异常信息如下:主要报:There was an unexpected error (type=Internal Server Error, status=500).Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "xxxxxxx/xxx", template might not exist or might not be accessible by any of the configured Template Resolvers找不到路径了。
一:网上大部分的解决办法:
@Controller
@RequestMapping("")
public class ExampleController {
@GetMapping("example")
public String Example(){
return "/example/list";

}
返回页面时,将return "/example/list"中前面的“/”去掉。
二:本人碰到及解决办法:
1、由于自己大意,将templates下面的文件夹名写成Example,在文件夹下创建list.html 。
2、在@Controller返回时,返回结果为:return "example/list",与路径Example/list,大小写不符。
2、在本地windows环境下运行,是不区分路径的大小写的,
3、当打包成jar,在linux服务器运行时,是区分大小写的。所以导致找不到路径。改成一样就行了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐