Error report content
circular view path [index]: would dispatch back to the current handler URL// login/index] again. Check your viewresolver setup( Hint: This may be the result of an unspecified view, due to default view name generation.)
Change @ controller to @ restcontroller
The @restcontroller annotation is equivalent to the function of @ResponseBody + @ controller
without annotation, @ResponseBody or @restcontroller will set the return value to JSON format, otherwise it will automatically think that you are returning a page
in the @ controller annotation, you can return a string or a template name that matches the string, that is, directly render the view and use it with HTML pages,
In this case, the front-end and back-end requirements are relatively high. The Java back-end code should be rendered in combination with HTML. The data of the model object (or modelandview) will be used to fill in the relevant attributes in the user view, and then displayed to the browser. This process can also be called rendering
In @restcontroller, you should return an object, that is, return a user object. At this time, you can also see that the return is a JSON string corresponding to a user object without a page. The function of the front end is to use the returned JSON to parse and render the page, and the code of the Java back end is relatively free.
Read More:
- [Solved] JSONUtil.toJsonStr() Error: org.springframework.web.util.NestedServletException: Handler dispatch failed…
- [Solved] org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- How to Solve Tomcat Error: Could not resolve view with name ‘xxx/xxxxxxx‘ in servlet with
- javaweb Connect Datas Error: che.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1444)
- Error:Cannot build artifact xxx:war exploded’ because it is included into a circular dependency
- How to Close the Current Form in JAVA Swing
- SpringCloud Use openFeign Multipartfile to Upload Files Error: Current request is not a multipart request
- [Solved] Java.lang.IllegalStateException: Type handler was null on parameter mapping for property ‘__frch_it
- JAVA Code Start Exception Error View Does Not Exsit [Solved]
- SpringMVc @RequestMapping url of regular expression pattern
- [Solved] Android monitors events error: back (toolbar)
- How to get the current time in java time string
- [Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified…bug
- [Solved] Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘:
- Java back end receives localdatetime type parameter
- How to Solve IntelliJ IDEA Error: Cannot determine path to ‘tools.jar‘ library for 17 (C:\Program Files\Java\jd…
- [Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url dubbo192.168.0.920880service
- [Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url: dubbo://192.168.0.9:20880/service
- [Solved] SpringBoot Microservices: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded dat