0 Replies Latest reply on Jul 16, 2007 8:36 PM by Robert Lin

    Confusing redirect for new view

    Robert Lin Newbie

      In the AjaxViewHandler restoreView() method, there's a comment:

      // New view created for AJAX request - indicate session
      // expiration.

      Directly following this comment there is a redirect.

      This is confusing me, as it seems to be causing my include tag not to work. Here it the sequence of events that I'm seeing:
      1. The page is rendered. Within the page is an ajax include
      2. Within the include, is a command button. This button is selected
      3. The resulting action of the button leads to a nagivation rule to be applied
      4. With the navigation rule, a new jsp is included
      5. The new jsp has never been rendered before. Therefore, the view root does not exist in the session
      6. The AjaxViewHandler.restoreView() method then, assuming the session has expired, tries to redirect.
      7. I then see an IllegalStateException because a redirect cannot be done during an include:

      at org.ajax4jsf.taglib.html.jsp.ServletResponseWrapperInclude.sendRedirect(ServletResponseWrapperInclude.java:184)
      at com.sun.faces.context.ExternalContextImpl.redirect(ExternalContextImpl.java:333)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:177)

      What is the expected behavior for the include tag after a navigation rule has been applied? Is the redirect expected? If not, is it expected that the view root already exist?

      Thank you for the help