ICEfaces
  1. ICEfaces
  2. ICE-11502

Implement robust window tracking via URL rewriting

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3, EE-3.3.0.GA_P07, EE-4.3.0.GA_P02
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Implement window tracking to ensure a reliable window scope that can cope with window reload and back and forward window navigation.

        Activity

        Mircea Toma created issue -
        Mircea Toma made changes -
        Field Original Value New Value
        Assignee Mircea Toma [ mircea.toma ]
        Hide
        Mircea Toma added a comment - - edited

        The obvious window tracking implementation is one based on URL rewriting. This will ensure that a window will be identified by a unique URL.
        Having two windows A and be B their corresponding URLs will look like http://host:port/context/file.jsf?jsfwid=A and http://host:port/context/file.jsf?jsfwid=B. Even though both windows show the same view they can have different states (captured by the window scope beans).

        The advantages of using URL rewriting are:

        • The window can still be tracked after a window reload, the browser will send a GET request using the URL that contains the window identifier.
        • The window is still tracked when a navigation is triggered, the URLs rendered by the application will all contain the window identifier.
        • The URL rewriting can be implemented by using the API that is available in JSF (encodeActionURL(url)).
        • ICEfaces can use the URL rewriting based window tracking that is already provided by JSF and implement only the window scope management (which is missing from JSF).
        • The bridge will need minor changes to send the window identifier into a format recognised by JSF.

        The disadvantages of using URL rewriting are:

        • Components that render URLs to other views need to be updated to encode the window identifier.
        • Confusions can occur when the URL of the page is copied and used in another window, thus having two windows tracked by the same identifier. Certain strategies can be added to eliminate this duplication.
        • More complex URLs, deployments that use reverse proxies or servlet filters will have to account for the new URL pattern.
        Show
        Mircea Toma added a comment - - edited The obvious window tracking implementation is one based on URL rewriting. This will ensure that a window will be identified by a unique URL. Having two windows A and be B their corresponding URLs will look like http://host:port/context/file.jsf?jsfwid=A and http://host:port/context/file.jsf?jsfwid=B . Even though both windows show the same view they can have different states (captured by the window scope beans). The advantages of using URL rewriting are: The window can still be tracked after a window reload, the browser will send a GET request using the URL that contains the window identifier. The window is still tracked when a navigation is triggered, the URLs rendered by the application will all contain the window identifier. The URL rewriting can be implemented by using the API that is available in JSF ( encodeActionURL(url) ). ICEfaces can use the URL rewriting based window tracking that is already provided by JSF and implement only the window scope management (which is missing from JSF). The bridge will need minor changes to send the window identifier into a format recognised by JSF. The disadvantages of using URL rewriting are: Components that render URLs to other views need to be updated to encode the window identifier. Confusions can occur when the URL of the page is copied and used in another window, thus having two windows tracked by the same identifier. Certain strategies can be added to eliminate this duplication. More complex URLs, deployments that use reverse proxies or servlet filters will have to account for the new URL pattern.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53267 Tue Jul 21 16:09:42 MDT 2020 mircea.toma ICE-11502 Factor out strategies used to track window scope. Implement URL based window scope tracking.
        Files Changed
        Commit graph ADD /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/JSFURLWindowScopeTracker.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java
        Commit graph ADD /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeTracker.java
        Commit graph ADD /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/TimeBasedWindowScopeTracker.java
        Commit graph ADD /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/LiferayWindowScopeTracker.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/linkbutton/LinkButtonRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53268 Tue Jul 21 16:17:54 MDT 2020 mircea.toma ICE-11502 Refactor. Change method name.
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/JSFURLWindowScopeTracker.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeTracker.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/TimeBasedWindowScopeTracker.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/LiferayWindowScopeTracker.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53277 Wed Jul 22 15:01:45 MDT 2020 mircea.toma ICE-11502 Move Liferay specific code into TimeBasedWindowScopeTracker as sub-strategy for tracking window ID.
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/JSFURLWindowScopeTracker.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/TimeBasedWindowScopeTracker.java
        Commit graph DEL /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/LiferayWindowScopeTracker.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53280 Wed Jul 22 16:01:34 MDT 2020 mircea.toma ICE-11502 Add back the preemptive test for window ID parameter.
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/TimeBasedWindowScopeTracker.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53281 Wed Jul 22 17:18:10 MDT 2020 mircea.toma ICE-11502 Add window ID parameter to the URL of the loaded page (without triggering a reload).
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/javascript/application.js
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
        Hide
        Mircea Toma added a comment -

        Factored out strategies used by ICEfaces to track the window scope. Implemented window scope management using the window tracking provided by JSF (URL based).

        Show
        Mircea Toma added a comment - Factored out strategies used by ICEfaces to track the window scope. Implemented window scope management using the window tracking provided by JSF (URL based).
        Hide
        Mircea Toma added a comment -

        Moved Liferay specific code into TimeBasedWindowScopeTracker as sub-strategy for tracking window ID (instead of having it as a top level strategy).

        Show
        Mircea Toma added a comment - Moved Liferay specific code into TimeBasedWindowScopeTracker as sub-strategy for tracking window ID (instead of having it as a top level strategy).
        Hide
        Mircea Toma added a comment -

        Improve URL tracking by adding window ID parameter to the URL of the loaded page (without triggering a reload) and thus allow an immediate reload of the page without window scope re-creation.

        Show
        Mircea Toma added a comment - Improve URL tracking by adding window ID parameter to the URL of the loaded page (without triggering a reload) and thus allow an immediate reload of the page without window scope re-creation.
        Hide
        Mircea Toma added a comment -

        Tested successfully Liferay substrategy using liferay-portal-6.2.0-ce-ga1 and liferay-faces-bridge-api-4.2.5-ga6.

        Show
        Mircea Toma added a comment - Tested successfully Liferay substrategy using liferay-portal-6.2.0-ce-ga1 and liferay-faces-bridge-api-4.2.5-ga6 .
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        To enable URL based window tracking and at the same time URL window management scope, one should set the JSF context parameter like:

        <context-param>
          <param-name>javax.faces.CLIENT_WINDOW_MODE</param-name>
          <param-value>url</param-value>
        </context-param>
        
        Show
        Mircea Toma added a comment - To enable URL based window tracking and at the same time URL window management scope, one should set the JSF context parameter like: <context-param> <param-name>javax.faces.CLIENT_WINDOW_MODE</param-name> <param-value>url</param-value> </context-param>
        Mircea Toma made changes -
        Affects Documentation (User Guide, Ref. Guide, etc.) [ 10003 ]
        Ken Fyten made changes -
        Affects Version/s EE-3.3.0.GA_P07 [ 13118 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P08 [ 13293 ]
        Fix Version/s EE-4.3.0.GA_P03 [ 13570 ]
        Hide
        Ken Fyten added a comment -

        Re-opened.

        This solution needs to be backported to work with the EE 3.3.0.GA_P08 release as well. We also have a lead customer on EE 3.3 waiting to test it for us to resolve their Window scope issue.

        Show
        Ken Fyten added a comment - Re-opened. This solution needs to be backported to work with the EE 3.3.0.GA_P08 release as well. We also have a lead customer on EE 3.3 waiting to test it for us to resolve their Window scope issue.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53300 Fri Aug 07 13:29:18 MDT 2020 mircea.toma ICE-11502 Re-introduce lookupAssociatedWindowID public method. Save windowID into request map for both window tracking implementations.
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/ICEfacesContext.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowELResolver.java
        Hide
        Mircea Toma added a comment -

        Re-introduced lookupAssociatedWindowID public method. Save windowID into request map for both window tracking implementations.

        Show
        Mircea Toma added a comment - Re-introduced lookupAssociatedWindowID public method. Save windowID into request map for both window tracking implementations.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        Ported the new implementation to icefaces-ee-3.3.0.GA-maintenance branch.

        Show
        Mircea Toma added a comment - Ported the new implementation to icefaces-ee-3.3.0.GA-maintenance branch.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #53310 Thu Aug 13 15:14:25 MDT 2020 mircea.toma ICE-11502 Avoid interfering with the browser history state when appending the window ID to the URL. Also, append the window ID after an update if necessary.
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/core/src/main/javascript/application.js
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Summary Implement robust window tracking Implement robust window tracking via URL rewriting
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mircea Toma
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: