项目打包后,报错template might not exist or might not be accessible by any of the configured Template Resolvers with root cause,肯定是找不到模板文件了,不过在IDEA中调试是没有问题的。
比对后发现,该controller返回的路径,以'/'开头的,导致在模板文件下查找文件出错。估计IDEA进行编译的时候,进行代码优化了,而通过package打包后则没能幸免。
本文探讨了项目在打包后出现templatemightnotexistormightnotbeaccessiblebyanyoftheconfiguredTemplateResolvers错误的原因及解决方案。指出IDEA调试时路径以'/'开头可能导致模板文件查找错误,提供了解决思路。
项目打包后,报错template might not exist or might not be accessible by any of the configured Template Resolvers with root cause,肯定是找不到模板文件了,不过在IDEA中调试是没有问题的。
比对后发现,该controller返回的路径,以'/'开头的,导致在模板文件下查找文件出错。估计IDEA进行编译的时候,进行代码优化了,而通过package打包后则没能幸免。
4053
5万+

被折叠的 条评论
为什么被折叠?
