Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3804

Use the same key in server side state saving for ajax requests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0
    • JSR-344
    • None

    Description

      The current code for server side state saving creates one key per request to store the view state. This is ok, but it is not necessary for ajax requests.

      The reason why is not necessary is because you can never go back to a page when using ajax. If you are on page A and the current request is an ajax request and it returns to the same page and the view is the same that the one that has been restored, the key or the token sent does not need to change, what changes is the internal state of the view. From the client side the page is the same. We can take advantage of this fact and just update the state stored in SerializedViewCollection for the view.

      The challenge here is detect when this strategy is applicable. For example, what happen if there is an ajax redirect? It looks is a good idea for implement in 2.2, because it avoids to store unnecessary information into session and optimize the use of each view slot.

      Attachments

        1. ajaxviewkeytest.patch
          6 kB
          Dora Rajappan
        2. ajaxviewkeytest2.patch
          2 kB
          Dora Rajappan
        3. ajaxviewsamekey.patch
          11 kB
          Dora Rajappan
        4. ajaxviewsamekey2.patch
          1 kB
          Dora Rajappan
        5. ajaxviewsamekey3.patch
          0.5 kB
          Dora Rajappan
        6. MYFACES-3804-4.patch
          32 kB
          Leonardo Uribe

        Issue Links

          Activity

            People

              lu4242 Leonardo Uribe
              lu4242 Leonardo Uribe
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: