为了账号安全,请及时绑定邮箱和手机立即绑定

将@RestController改成@Controller引入了thymeleaf依赖,前台请求后台还是报错。

2018-08-25 11:53:47.848  INFO 15024 --- [nio-8080-exec-1] o.a.c.c.C.[.[localhost].[/spring-boot]   : Initializing Spring FrameworkServlet 'dispatcherServlet'

2018-08-25 11:53:47.848  INFO 15024 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started

2018-08-25 11:53:47.879  INFO 15024 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 31 ms

2018-08-25 11:53:48.051 ERROR 15024 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine             : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "index": Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers

2018-08-25 11:53:48.051 ERROR 15024 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/spring-boot] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause


org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers

at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.6.RELEASE.jar:2.1.6.RELEASE]


创建好了template/index.html文件。

正在回答

1 回答

你看一下pom.xml里面是不是少了thymeleaf的依赖

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
2小时学会Spring Boot
  • 参与学习       151599    人
  • 解答问题       1079    个

Spring Boot入门视频教程,你将学会使用Spring Boot快速构建应用程序

进入课程

将@RestController改成@Controller引入了thymeleaf依赖,前台请求后台还是报错。

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信