javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

Spring JIRA | 俞火江 | 1 year ago
  1. 0

    When I add @ResponseBody on the method level as follows: {code:java} @Controller //@ResponseBody public class UserController { @RequestMapping("/hello") @ResponseBody public String hello() { return "hello"; } } {code} It works as expected. However, if I add the annotation on the type level: {code:java} @Controller @ResponseBody public class UserController { @RequestMapping("/hello") //@ResponseBody public String hello() { return "hello"; } } {code} Then an exception is thrown: Servlet.service() for servlet [dispatcher] in context with path [/practice] threw exception [Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)] with root cause javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.) at org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:205) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:145) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)

    Spring JIRA | 1 year ago | 俞火江
    javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
  2. 0

    When I add @ResponseBody on the method level as follows: {code:java} @Controller //@ResponseBody public class UserController { @RequestMapping("/hello") @ResponseBody public String hello() { return "hello"; } } {code} It works as expected. However, if I add the annotation on the type level: {code:java} @Controller @ResponseBody public class UserController { @RequestMapping("/hello") //@ResponseBody public String hello() { return "hello"; } } {code} Then an exception is thrown: Servlet.service() for servlet [dispatcher] in context with path [/practice] threw exception [Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)] with root cause javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.) at org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:205) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:145) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)

    Spring JIRA | 1 year ago | 俞火江
    javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
  3. 0

    GitHub comment 9183#131106046

    GitHub | 1 year ago | orubel
    javax.servlet.ServletException: ModelAndView [ModelAndView: materialized View is [null]; model is {fname=Bob, lname=Dobbes, address=3401 16th ave s}] neither contains a view name nor a View object in servlet with name 'grailsDispatcherServlet'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Workflow details on share using allinone-archetype

    GitHub | 2 years ago | mindthegab
    javax.servlet.ServletException: Could not resolve view with name '_d41d8cd98f0b24e980998ecf8427e' in servlet with name 'Spring Surf Dispatcher Servlet'
  6. 0

    "Circular view path" in a simple Spring Boot project with a Controller

    Stack Overflow | 2 years ago | logoff
    javax.servlet.ServletException: Circular view path [test]: would dispatch back to the current handler URL [/test] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

  1. Luka 8 times, last 2 months ago
  2. dafman 4 times, last 3 months ago
  3. smyrgeorge 3 times, last 4 months ago
  4. WoodenDoors 3 times, last 9 months ago
22 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.servlet.ServletException

    Circular view path [hello]: would dispatch back to the current handler URL [/practice/main/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

    at org.springframework.web.servlet.view.InternalResourceView.prepareForRendering()
  2. Spring MVC
    FrameworkServlet.doGet
    1. org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:205)
    2. org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:145)
    3. org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
    4. org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244)
    5. org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
    6. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
    7. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    8. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    9. org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
    9 frames