异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成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");
这行代码,去掉最前面的"/"就好了!