TemplateInputException—spring bo

2020-08-07  本文已影响0人  温酒居士

异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成jar包部署到服务器上时,就一直报异常,异常信息如下:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/content/content], template might not exist or might not be accessible by any of the configured Template Resolvers

经过大量的排查,最终的问题出在

mv.setViewName("/content/content");

这行代码,去掉最前面的"/"就好了!


image.png 公众号.png
上一篇 下一篇

猜你喜欢

热点阅读