Detailed error code (PS: the title of the main code to write the error)
Javax.servlet.ServletException:Circular view path [Hello]: would dispatch back to the current handler URL [/hello] again. Check your Viewresolver setup! (Hint:this May is the result of a unspecified view, due to default view name generation.) At Org.springframework.web.servlet.view.InternalResourceView.prepareForRendering (internalresourceview.java:209) ~[spring-webmvc-5.0.8.release.jar:5.0.8.release] At Org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel (Internalresourceview.java : 147) ~[spring-webmvc-5.0.8.release.jar:5.0.8.release] at Org.springframework.web.servlet.view.AbstractView.render (abstractview.java:314) ~[ Spring-webmvc-5.0.8.release.jar:5.0.8.release] at Org.springframework.web.servlet.DispatcherServlet.render ( dispatcherservlet.java:1325) ~[spring-webmvc-5.0.8.release.jar:5.0.8.release] at Org.springframework.web.servlet.DispatcherServlet.processDispatchResult (dispatcherservlet.java:1069) ~[ spring-webmvc-5.0.8.release.jar:5.0.8. RELEASE] at Org.springframework.web.servlet.DispatcherServlet.doDispatch (dispatcherservlet.java:1008) ~[ Spring-webmvc-5.0.8.release.jar:5.0.8.release] at Org.springframework.web.servlet.DispatcherServlet.doService ( dispatcherservlet.java:925) ~[spring-webmvc-5.0.8.release.jar:5.0.8.release] at Org.springframework.web.servlet.FrameworkServlet.processRequest (frameworkservlet.java:974) ~[ Spring-webmvc-5.0.8.release.jar:5.0.8.release] at Org.springframework.web.servlet.FrameworkServlet.doGet ( frameworkservlet.java:866) ~[spring-webmvc-5.0.8.release.jar:5.0.8.release]
1. The origin of the problem
IDEA中测试使用spring boot+freemarker时启动报错
2. Causes
@RequestMapping("hello")中的路径与映射方法返回的视图名冲突了,不能写一样的
(原来哪个代码图片找不到了,所以就直接写了一个,这只是例子,所以图中的错误可以忽略)
3. Workaround
改一下视图名或者@RequestMapping 中的值就可以了....
4. Summary is not really a very advanced error, but it is easy for beginners to make mistakes, to avoid ... Reference
I've been to the top of the mountain and I've fallen down, both of which have benefited me a lot----Jewel Rider
Idea under Spring Boot+fremarker start error would dispatch back to the current handler URL [/hello] again. Check your Viewresolver setup!