Announcement Announcement Module
Collapse
No announcement yet.
SimpleMappingExceptionResolver - error view not rendered Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleMappingExceptionResolver - error view not rendered

    Hi,

    I configured the SimpleMappingExceptionResolver to redirect to a generic error page for all Exceptions:

    Code:
    <bean class="org.springframework...SimpleMappingExceptionResolver">
      <property name="defaultErrorView" value="error" />
    </bean>
    I placed an error.xhtm under /WEB-INF/error.xhtml. If I access the error.xhtml by entering the absolute URL in a browser window e.g http://localhost:8080/spring/error, the page is rendered as expected. However when the page is accesed by the Exception Resolver as result of an exception, nothing happens.

    When I look at the network traffic e.g. using Fiddler I see the Request that looks as expected but the Response contains something like this:

    Code:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Pragma: no-cache
    Expires: Thu, 01 Jan 1970 00:00:00 GMT
    Cache-Control: no-cache
    Cache-Control: no-store
    X-Powered-By: JSF/2.0
    X-Powered-By: JSF/2.0
    Cache-Control: no-cache
    Content-Type: text/xml;charset=UTF-8
    Content-Language: de-DE
    Content-Length: 76
    Date: Wed, 20 Jun 2012 09:49:45 GMT
    
    <?xml version='1.0' encoding='UTF-8'?>
    <partial-response></partial-response>

    Can anybody tell my whats wrong?



    Best regards

    Sebastian

  • #2
    Hi,

    after doing some other stuff for our project we finally got back to the problem described above. After doing some research it becomes clear that the problem only occurs for ajax requests. If an exception is thrown on the server side while processing an ajax request, the ExceptionResolver is not able to redirect to the configured error page.

    1. Is this is bug in the ExceptionResolver? I would expect that the resolver writes something like (see below) to the response.

    Code:
    <partial-response><redirect url="/myErrorPage"></redirect></partial-response>
    2. If this is not a bug, what is the concept in spring webflow to deal with exceptions that occur in the processing of ajax requests. How can I display an error message to the user?


    Best regards

    Sebastian

    Comment

    Working...
    X