[ 
https://issues.apache.org/jira/browse/MYFACES-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520533
 ] 

Thomas Fischer commented on MYFACES-1711:
-----------------------------------------

Added a second version of the patch.
The first version ( File 1: ChangedParametersRequestWrapper.java and File 4: 
RedirectErrorHandler.java) is a implementation of the dispatching error handler 
described above with no changes to the current error handling behaviour.
The second version (File 1: ChangedParametersRequestWrapper.java, File 2:  
myfaces-error-handler.patch.txt  and File 3: RedirectErrorHandler.java) 
improves (in my eyes) the existing behaviour to handle also Errors, plus it 
provides an interface for the ExceptionHandler, plus it saves the throwable in 
the request scope (the last feature could also be backported to version 1).

> Redirecting Error Handler 
> --------------------------
>
>                 Key: MYFACES-1711
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1711
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: General
>    Affects Versions: 1.2.1-SNAPSHOT
>            Reporter: Thomas Fischer
>            Priority: Minor
>         Attachments: ChangedParametersRequestWrapper.java, 
> myfaces-error-handler.patch.txt, RedirectErrorHandler.java, 
> RedirectErrorHandler.java
>
>
> This patch provides an error handler which redirects the user to an error 
> page if an error occurs. The features are:
> - the error page can be a jsf page
> - the error page is customizable by overriding a method in the error handler
> - loop detection (i.e. if an error occurs on the error page, an exception is 
> thrown instead of endlessly looping)
> - no redirect is sent to the browser(i.e. all request scoped attributes 
> survive the redirect)
> The error handler works by cleaning all HTTP request parameters from the 
> request and dispatching the cleaned request to the error page. Cleaning the 
> request parameters is necessary because myfaces gets confused if the error 
> occurs in a postback and the error page is a jsf page. 
> The original request parameters can be retrieved by casting the request to 
> HttpServletRequestWrapper, retrieving its wrapped request by getRequest() and 
> asking the wrapped request for the request parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to