[ 
https://issues.apache.org/jira/browse/MYFACES-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620725#action_12620725
 ] 

Leonardo Uribe commented on MYFACES-1848:
-----------------------------------------

After several days trying to solve this issue, some conclusions arise:

1. This problem is not present on myfaces core 1.1.6-SNAPSHOT. 

so 

2. There was some change between 1.1 and 1.2 related to this issue, rather than 
a bug on myfaces error handling capability

Finally the solution is on method buildView of class JspViewHandlerImpl. This 
method wraps the response and this is when the problem begins. When a call to 
dispatch fails (jsp error) the response is not restored, so all error output 
goes to the wrapped response instead the real response (what we want).

The solution is do something like this:

    private boolean buildView(ServletResponse response, ExternalContext 
externalContext, String viewId) throws IOException {
        ViewResponseWrapper wrappedResponse = new 
ViewResponseWrapper((HttpServletResponse) response);

        externalContext.setResponse(wrappedResponse);
        try
        {
            externalContext.dispatch(viewId);
        }
        finally
        {
            externalContext.setResponse(response);
        }

        /*...............more code............*/

So if an jsp error occurs the response is restored and the blank page is 
replaced by the error page. This change has no effect on the old behavior of 
JspViewHandlerImpl.


> JSP regular exceptions causes vlack page output
> -----------------------------------------------
>
>                 Key: MYFACES-1848
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1848
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Guy Bashan
>            Assignee: Leonardo Uribe
>
> The new JSF (1.2.2) outputs a nice formatted exception message (with session 
> variables, view and full stacktrace).
> But when I get error in the page caused by JSP, I simply see a blank page (I 
> am able to see the exception itself in the console ...)

-- 
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