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

Martin Kočí commented on MYFACES-3189:
--------------------------------------

Steps to reproduce:
1) provide own exception handler: 
http://weblogs.java.net/blog/edburns/archive/2009/09/03/dealing-gracefully-viewexpiredexception-jsf2
 
2) ExceptionHandler snippet:

if (t instanceof ViewExpiredException) {
  NavigationHandler nav = facesContext.getApplication().getNavigationHandler();
try {
    nav.handleNavigation(facesContext, null, "/NonExistentViewExpired.xhtml");
   facesContext.renderResponse();
  } finally {
    i.remove();
  }
}

3) deploy; simulate ViewExpiredException, for example modify ViewState value in 
DOM with firebug and submit view
4) NPE appears: java.lang.NullPointerException
        at 
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:60)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render

Environment: myfaces 2.1.2-SNAPSHOT, Tomcat 6.0.26

To problem is in  "/NonExistentViewExpired.xhtml" - if case of VVE, there is no 
UIViewRoot restored and if NonExistentViewExpired  does not exists, there is no 
UIViewRoot to render.


> NavigationHandler: navigation to nonexistent view after ViewExpired throws NPE
> ------------------------------------------------------------------------------
>
>                 Key: MYFACES-3189
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3189
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.0.8-SNAPSHOT, 2.1.2-SNAPSHOT
>            Reporter: Martin Kočí
>
> see 
> http://weblogs.java.net/blog/edburns/archive/2009/09/03/dealing-gracefully-viewexpiredexception-jsf2
> If user provides nonexistent viewId, NPE occurs: MYFACES-3188
> navigation in this situation leads to facesContext.viewRoot = null. I don't 
> know what spec says about it but mojarra stays on current view in this case 
> (navigate?) - on that view, where VVE is. 
> We should also provide a warning about this situation.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to