Recent learning Spring boot has seen this:
Circular view Path [readinglist]: would dispatch back to the current handler URL [/readinglist] again. Check your Viewresolver setup! (Hint:this May is the result of a unspecified view, due to default view name generation.
The reasons are as follows:
when no viewresolver is declared , Spring registers a default viewresolver for you, which is an instance of Jstlview, which inherits from Internalresoureview.
Jstlview is used to encapsulate a JSP or other resource in the same Web application, exposing the model object as a property value for request requests and forwarding the request through Javax.servlet.RequestDispatcher to the specified URL.
Spring believes that the URL of this view can be used to specify specific resources in the same Web application, and can be forwarded by RequestDispatcher.
That is, before page rendering (render), spring attempts to use RequestDispatcher to continue forwarding the request. the following code:
if (Path.startswith ("/")? Uri.equals (Path): Uri.equals (Stringutils.applyrelativepath (URI, Path)) {
throw new Servletexception ("Circular View path [" + Path + "]: would dispatch back" + "to the current
handler URL [" + URI + "] Again. Check your Viewresolver setup! "+
" (Hint:this May is the result of a unspecified view, due to default view name generation.);
}
As you can see from this code, if your view name and your path are the same string, according to spring's forwarding rules, you will be able to forward it to yourself and be trapped in a dead loop. So spring checks this out and throws a Circular view path exception. Boot, using Thymeleaf, will join the starter dependency, the time to introduce this dependency, boot will automatically configure the forwarding rules, so long as you remember in the Pom file declaration of dependency can be
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactid>spring-boot-starter-thymeleaf</artifactid>
</dependency >
Spring will also encounter this situation, the same principle, if you do not declare viewresolver, this problem will occur. I am in the controller, without @responsebody annotations, directly return the "index" string, to map
INDEX.JSP will enter the code above, judging the URI and JSP name are the same, are index