MyFaces Core
  1. MyFaces Core
  2. MYFACES-3162

AJAX Broken when State Caching Mechanics turned off

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 2.0.7, 2.1.1
    • Component/s: General
    • Labels:
      None
    • Environment:
      MyFaces 2.0.6, RichFaces 4.0.Final, Tomcat 6

      Description

      When the web configuration param "org.apache.myfaces.HANDLE_STATE_CACHING_MECHANICS" is set to false, after the first ajax call, all further ajax calls fail. The failure occurs with a ViewExpiredException on the next ajax call. The reason is that the sequence number part of the view state is being lost during the first ajax call. (See HtmlResponseStateManager.getViewState() where baseState is lost when isHandlingStateCachingMechanics(facesContext) returns false.

      1. MYFACES-3162-1.patch
        0.6 kB
        Leonardo Uribe

        Activity

        James G created issue -
        Leonardo Uribe made changes -
        Field Original Value New Value
        Attachment MYFACES-3162-1.patch [ 12480980 ]
        Hide
        Leonardo Uribe added a comment -

        Yes, you're right. The solution is very simple, just if isHandlingStateCachingMechanics(facesContext) returns false take the one passed as param.

        Note myfaces state manager since 2.0.6 and 2.1.0 is org.apache.myfaces.application.StateManagerImpl, so this param has sense when it is required to use the previous one org.apache.myfaces.application.jsp.JspStateManagerImpl or a custom implementation that relies on the previous behavior, but take into account the new behavior is preferred because it is more aligned with the spec "intention".

        Show
        Leonardo Uribe added a comment - Yes, you're right. The solution is very simple, just if isHandlingStateCachingMechanics(facesContext) returns false take the one passed as param. Note myfaces state manager since 2.0.6 and 2.1.0 is org.apache.myfaces.application.StateManagerImpl, so this param has sense when it is required to use the previous one org.apache.myfaces.application.jsp.JspStateManagerImpl or a custom implementation that relies on the previous behavior, but take into account the new behavior is preferred because it is more aligned with the spec "intention".
        Leonardo Uribe made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 2.0.7 [ 12316465 ]
        Fix Version/s 2.1.1 [ 12316463 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            James G
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development