Spring Boot使用thymeleaf模板时报异常:template might not exist or might not be accessible by any of the configured Template Resolvers

错误如下:

template might not exist or might not be accessible by any of the configured Template Resolvers

解决方法:

1、确定模板是否在默认templates文件夹里面,并且路径要和返回的View名字一致。

2、new ModelAndView("/log/loglist");这样写是不对的,应该把开头的斜杠去掉,改成:new ModelAndView("log/loglist");

 

参考:

http://blog.csdn.net/linxingliang/article/details/52566941

https://stackoverflow.com/questions/24260520/error-resolving-template-pages-template-might-not-exist-or-might-not-be-acces

你可能感兴趣的:(Spring Boot使用thymeleaf模板时报异常:template might not exist or might not be accessible by any of the configured Template Resolvers)