Hi,

i think there is a bug in restoreView when a request ist forwarded to
another viewId. In this case the viewId is "ignored" an restoreView computes
the viewRoot with the request-parameters and/or state.

You can reproduce this bug, when you create your own error-page, e.g. for
error-code 500. Then the servlet-engine makes a forward to your error-page.

I want to use the same view-technologie for error-pages as well...
If you're interested in own error-pages, i found a workaround for this
issue. I configured my own <application-factory>. The mehtod
getViewHandler() delivers my own ViewHandler. This ensures, that my
ViewHandler is the first ViewHandler. In case of an error-pages i don't
restore the view, but create it (every time):

In detail, my method restoreView looks as follows:

    public UIViewRoot restoreView(FacesContext context, String viewId)
    {
      Map requestMap = context.getExternalContext().getRequestMap();
      if (requestMap.containsKey("javax.servlet.error.exception"))
      {
        UIViewRoot viewRoot = viewHandler.createView(context, viewId);
        viewRoot.setViewId(viewId);
        context.renderResponse();
        return viewRoot;
      }
      else
      {
        return super.restoreView(context, viewId);
      }
    }

Best regards
Daniel
-- 
View this message in context: 
http://www.nabble.com/-Trinidad--bug-in-restoreView-%21---e.g.-own-error-page-tp17880818p17880818.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to