javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-121

Store Session States on a per window and viewid basis

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      121

      Description

      I really like the new Session state saving. However, I wonder if one more step
      can be taken to make it just a bit better.

      I have a situation where if I create a popup window that is using JSF and the
      user navigates around the popup to many times then the state of the parent
      window disappears off of the LRUMap making the parent window unusable when the
      user closes the popup and attempts to use the parent window again. The same
      could hold true for a frame too. If a user navigates inside of a frame too many
      times then the outer frame will quickly become expired and unusable.

      So, I was wondering if it might be a good idea to add a "window" aspect to the
      state. So the viewMap becomes 2 dimensional with the view’s lru map existing
      inside of another lru map for windows. When a response is rendered it creates a
      new FACES_VIEW like it does now but if the response came from a request with an
      existing windowId the view will be stored in the existing window's lru map.
      Otherwise a new windowId is created and the view is stored in the new windowId.

      This will allow for a more application specific utilization of server memory.
      Currently if a developer wishes to have 2 JSF pages in frames he must set the
      NUMBER_OF_VIEWS_IN_SESSION to a very high number to maintain the user
      experience. But if views were associated with windows the developer could maybe
      set:

      NUMBER_OF_VIEWS_IN_WINDOW = 3
      NUMBER_OF_WINDOWS_IN_SESSION = 10

      This will allow the user to go back 3 views in the current window before it
      expires but would allow 10 brand new views to be created before the windows
      begin expiring.

      Sure the number of Windows could run out quickly too if the other windows are
      redirecting or creating new views often, but, at least the developer would be
      able to tune their application more effectively to make such occurrences more rare.

      I hope this makes sense.

      Mike

      1. jsfri121.tar.gz
        25 kB
        Ed Burns
      2. message.txt
        59 kB
        Ed Burns

        Activity

        Hide
        Ed Burns added a comment -

        fix checked in

        Show
        Ed Burns added a comment - fix checked in
        Hide
        youngm added a comment -

        Looks like I might be too late with this comment. But here it is anyway.

        This looks good. I can't build to find out though because I don't have
        el-api.jar and your diff appears to be based off of head instead of the branch.
        However, based on the source everything looks good.

        One comment though. The old state saving method was slightly more efficient
        than this method for people who don't have frames, popups, or don't care so much
        about people navigating their site in multiple windows. Would it be
        possible/difficult to have both session state saving method implementations
        available to the user?

        Mike

        Show
        youngm added a comment - Looks like I might be too late with this comment. But here it is anyway. This looks good. I can't build to find out though because I don't have el-api.jar and your diff appears to be based off of head instead of the branch. However, based on the source everything looks good. One comment though. The old state saving method was slightly more efficient than this method for people who don't have frames, popups, or don't care so much about people navigating their site in multiple windows. Would it be possible/difficult to have both session state saving method implementations available to the user? Mike
        Hide
        Ed Burns added a comment -

        Anything is possible, it's just code, he says with hubris, but is it really
        worth the added complexity? Can you please provide some concrete analysis? It
        doesn't have to be anything complex, just convince me it's worth it.

        Show
        Ed Burns added a comment - Anything is possible, it's just code, he says with hubris, but is it really worth the added complexity? Can you please provide some concrete analysis? It doesn't have to be anything complex, just convince me it's worth it.
        Hide
        youngm added a comment -

        It's not that big of a deal. I say we just leave it and see if anyone actually
        has a problem with this technique when they start using it. I know I don't have
        a problem with it.

        Mike

        Show
        youngm added a comment - It's not that big of a deal. I say we just leave it and see if anyone actually has a problem with this technique when they start using it. I know I don't have a problem with it. Mike
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            Ed Burns
            Reporter:
            youngm
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: