报错如下:
2100-01-01 13:14:00.666 [http-nio-8989-exec-1] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] threw exception
javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
我的application.yml文件是没有问题的,一直觉得是路径有问题,后面发现是少导入了一个,但是我看其他人没导入这个支持包也可以运行,看不懂.....
导入后,就能顺利找到页面并且解析了
总结:
1.导入图中的依赖
2.yml文件中配置freemarker: suffix: .ftl 不要漏了,但是现在springboot否认的后缀好像是ftlh