MyFaces Core
  1. MyFaces Core
  2. MYFACES-2452

Myfaces doesn't provide support for "Enable RestoreView 1.1 Compatibility" like sun ri implementation

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.8
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Environment:
      Window, Linux, AIX, JBoss and WAS app server, AJAX4JSF, Jsf1.2, Facelets 1.1.14

      Description

      JSF 1.2
      Facelets 1.1.14
      AJAX4JSF [richfaces-ui-3.3.2.SR1]
      State Saving : Server

      Myfaces implementation doesn't provide support for the compatibility RestoreView according to JSF1.1 where if viewroot is null, it will be created again instead of throw ViewExpiredException. Sun JSF RI provides a compatibility mode using parameter com.sun.faces.enableRestoreView11Compatibility in the web.xml and then if configured it will be consulted while taking decision to create the view again or throw the ViewExpired exception.
      Due to this after moving to JSF 1.2 it keep on throwing VewExpiredException if couldn't be found in the session map, when state saving method is server.
      Please refer to the code in class com.sun.faces.lifecycle.RestoreViewPhase#execute method
      -------------------------------------------------------------------------------------------------------
      public void execute(FacesContext facesContext) throws FacesException {
      :
      boolean isPostBack = (facesContext.isPostback() && !isErrorPage(facesContext));
      196 if (isPostBack) {
      197 facesContext.setProcessingEvents(false);
      198 // try to restore the view
      199 viewRoot = viewHandler.restoreView(facesContext, viewId);
      200 if (viewRoot == null) {
      201 if (is11CompatEnabled(facesContext)) {
      202 // 1.1 -> create a new view and flag that the response should
      203 // be immediately rendered
      204 if (LOGGER.isLoggable(Level.FINE))

      { 205 LOGGER.fine("Postback: recreating a view for " + viewId); 206 }

      207 viewRoot = viewHandler.createView(facesContext, viewId);
      208 facesContext.renderResponse();
      209
      210 } else {
      211 Object[] params =

      {viewId}

      ;
      212 throw new ViewExpiredException(
      213 MessageUtils.getExceptionMessageString(
      214 MessageUtils.RESTORE_VIEW_ERROR_MESSAGE_ID,
      215 params),
      216 viewId);
      217 }
      218 }
      219
      220 facesContext.setViewRoot(viewRoot);
      221 facesContext.setProcessingEvents(true);
      222 if (LOGGER.isLoggable(Level.FINE))

      { 223 LOGGER.fine("Postback: restored view for " + viewId); 224 }

      225 }
      -------------------------------------------------------------------------------------------------------------------------------------
      Similar support should be provided by Mayfaces also. With sate saving as server, the state saving/restoring is not very reliable and throw VEE many a times. RichFaces also uses the parameter com.sun.faces.enableRestoreView11Compatibility to run its test suite.

      This is really a blocking issue until the problem of state saving at server is not fully solved and made reliable.

        Activity

        Agam Dass created issue -
        Agam Dass made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Agam Dass
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development