message Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template “/error/error”, template might not exist or might not be accessible by any of the configured Template Resolvers
这个报错有两种原因
第一种:return 模板的时候前面加了个斜杠 例如 :return “/web/shifthtml”,
去掉前面的斜杠 改成 return “web/shifthtml” 就好了
还有就是在配置文件加spring.thymeleaf.prefix=classpath:/templates也能解决
还有一种原因是
你的controller
如果返回值你设置的为空的话,那么就是没有返回值 所以返回不了页面。也会出现这个错误,
解决方法: 在方法上加个 @ResponseBody 注解就好了,因为你并不需要返回页面
解决Error resolving template template might not exist or might not be accessible问题
最新推荐文章于 2025-03-15 12:30:21 发布