ICEfaces
  1. ICEfaces
  2. ICE-6881

delegate createActionURL to HttpServletResponse

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P02
    • Fix Version/s: EE-1.8.2.GA_P03
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces

      Description

      Currently encodeActionURL is a pass-through in the Servlet case:

           public String encodeActionURL(String url) {
              return url;
           }

      This does not give the opportunity for Response wrappers to add functionality.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24604 Tue May 17 10:59:40 MDT 2011 ted.goddard call response.encodeURL (ICE-6881)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
        Ted Goddard created issue -
        Ted Goddard made changes -
        Field Original Value New Value
        Assignee Ted Goddard [ ted.goddard ]
        Ted Goddard made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ted Goddard added a comment -

        This could have side-effects for anything that uses action URLs, such as command
        links and forms. From the documentation, of HttpServletResponse, it looks like
        this code change should have no effect under most cases. However, the jsessionid
        may be encoded into the URL, so that could affect applications where the
        first page visited is an ICEfaces page prior to a session being established.

        Show
        Ted Goddard added a comment - This could have side-effects for anything that uses action URLs, such as command links and forms. From the documentation, of HttpServletResponse, it looks like this code change should have no effect under most cases. However, the jsessionid may be encoded into the URL, so that could affect applications where the first page visited is an ICEfaces page prior to a session being established.
        Hide
        Judy Guglielmin added a comment -

        Although the correct url is now shown, when using push, the following exceptions occur:-
        1)
        11:51:01,253 ERROR [PersistentFacesState] Exception occured during execute push on Unknown View
        javax.faces.FacesException: java.lang.NullPointerException
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:284)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:310)
        at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:141)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:680)
        Caused by: java.lang.NullPointerException
        at com.icesoft.faces.application.ViewRootStateManagerImpl.restoreView(ViewRootStateManagerImpl.java:105)
        at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:76)
        at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:260)
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:175)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        ... 8 more

        and the other one (both trace back to PersistentFacesState.execute (284):-
        11:51:01,253 ERROR [PersistentFacesState] Exception occured during execute push on Unknown View
        javax.faces.FacesException: java.lang.NullPointerException
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:284)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:310)
        at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:141)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:680)
        Caused by: java.lang.NullPointerException
        at com.icesoft.faces.application.ViewRootStateManagerImpl.restoreView(ViewRootStateManagerImpl.java:105)
        at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:76)
        at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:260)
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:175)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        ... 8 more

        Show
        Judy Guglielmin added a comment - Although the correct url is now shown, when using push, the following exceptions occur:- 1) 11:51:01,253 ERROR [PersistentFacesState] Exception occured during execute push on Unknown View javax.faces.FacesException: java.lang.NullPointerException at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128) at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:284) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:310) at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:141) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NullPointerException at com.icesoft.faces.application.ViewRootStateManagerImpl.restoreView(ViewRootStateManagerImpl.java:105) at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:76) at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:260) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:175) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) ... 8 more and the other one (both trace back to PersistentFacesState.execute (284):- 11:51:01,253 ERROR [PersistentFacesState] Exception occured during execute push on Unknown View javax.faces.FacesException: java.lang.NullPointerException at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128) at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:284) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:310) at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:141) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NullPointerException at com.icesoft.faces.application.ViewRootStateManagerImpl.restoreView(ViewRootStateManagerImpl.java:105) at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:76) at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:260) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:175) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) ... 8 more
        Hide
        Judy Guglielmin added a comment -

        every once in a while, the conversationid comes out on the url as a page parameter. Looking at code in PersistentFacesState.execute...
        Map requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();
        requestParameterMap.clear();
        if (SeamUtilities.isSeamEnvironment())

        { //ICE-2990/JBSEAM-3426 must have empty requestAttributes for push to work with Seam ((BridgeExternalContext) facesContext.getExternalContext()).removeSeamAttributes(); }

        then the following line is commented out:-

        //Seam appears to need ViewState set during push
        // see below
        // requestParameterMap.put("javax.faces.ViewState", "ajaxpush");

        not sure if this has anything to do with it as there is no comment on when this was commented out.
        Anyhow, this exception is not consistent and can cause problems when it cannot find hibernate (no access to data). Still trying to figure out how to consistently get this exception thrown, but considering it has something to do with page parameters and conversationid occasionally getting parsed onto the url.

        Show
        Judy Guglielmin added a comment - every once in a while, the conversationid comes out on the url as a page parameter. Looking at code in PersistentFacesState.execute... Map requestParameterMap = facesContext.getExternalContext().getRequestParameterMap(); requestParameterMap.clear(); if (SeamUtilities.isSeamEnvironment()) { //ICE-2990/JBSEAM-3426 must have empty requestAttributes for push to work with Seam ((BridgeExternalContext) facesContext.getExternalContext()).removeSeamAttributes(); } then the following line is commented out:- //Seam appears to need ViewState set during push // see below // requestParameterMap.put("javax.faces.ViewState", "ajaxpush"); not sure if this has anything to do with it as there is no comment on when this was commented out. Anyhow, this exception is not consistent and can cause problems when it cannot find hibernate (no access to data). Still trying to figure out how to consistently get this exception thrown, but considering it has something to do with page parameters and conversationid occasionally getting parsed onto the url.
        Hide
        Judy Guglielmin added a comment -

        t appears that when there are urls like the following:-
        http://10.18.39.112:8080/ice-blog/?conversationId=193

        (note the conversationid parameter) and then a push is triggered, the exception is thrown. LIkewise, for some reason using Chrome, there occasionally pops up a &JSessionId parameter on the url and that causes problems as well.

        Only locked up the appication once, but would be nice if we could avoid the exceptions altogether.

        If you add a new blog, once you post it, the conversationid parameter becomes part of the url. Looking at the app to see if there is something that can be done there.

        Show
        Judy Guglielmin added a comment - t appears that when there are urls like the following:- http://10.18.39.112:8080/ice-blog/?conversationId=193 (note the conversationid parameter) and then a push is triggered, the exception is thrown. LIkewise, for some reason using Chrome, there occasionally pops up a &JSessionId parameter on the url and that causes problems as well. Only locked up the appication once, but would be nice if we could avoid the exceptions altogether. If you add a new blog, once you post it, the conversationid parameter becomes part of the url. Looking at the app to see if there is something that can be done there.
        Hide
        Judy Guglielmin added a comment -

        note that this example should be dropped into jboss-seam-2.2.0.GA/examples folder and that there is a readme file that also stipulates the "icefaces.home" property to be updated within build.xml of this application (ice-blog).

        It was tested with latest from ICEfaces-1.8 trunk (p03 preview) on jboss-5.1.0.GA

        Show
        Judy Guglielmin added a comment - note that this example should be dropped into jboss-seam-2.2.0.GA/examples folder and that there is a readme file that also stipulates the "icefaces.home" property to be updated within build.xml of this application (ice-blog). It was tested with latest from ICEfaces-1.8 trunk (p03 preview) on jboss-5.1.0.GA
        Judy Guglielmin made changes -
        Attachment ice-blog.zip [ 13242 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000GtkkB]
        Ken Fyten made changes -
        Affects [Compatibility/Configuration]
        Hide
        Judy Guglielmin added a comment -

        add the following to index.xhtml within the data table to test this with <ice:outputLink>
        <div id="linkexampleone" rendered="#

        {blogEntry.excerpt!=null}

        " >

        <ice:outputLink id="icelink" value="/entry.xhtml" >
        <f:param name="blogEntryId" value="#

        {blogEntry.id}

        "/>
        <ice:outputText value="outputLink one"/>
        </ice:outputLink>
        </div>

        this works just fine. The url that is encoded within the rendered markup stays the same throughout the entire time of testing. navigated away and back from the index page and did several pushes and it's all good. the uri that comes up when clicked and the one that is encoded all conform to seam-urlrewrite rules in pages.xml

        Show
        Judy Guglielmin added a comment - add the following to index.xhtml within the data table to test this with <ice:outputLink> <div id="linkexampleone" rendered="# {blogEntry.excerpt!=null} " > <ice:outputLink id="icelink" value="/entry.xhtml" > <f:param name="blogEntryId" value="# {blogEntry.id} "/> <ice:outputText value="outputLink one"/> </ice:outputLink> </div> this works just fine. The url that is encoded within the rendered markup stays the same throughout the entire time of testing. navigated away and back from the index page and did several pushes and it's all good. the uri that comes up when clicked and the one that is encoded all conform to seam-urlrewrite rules in pages.xml
        Hide
        Ted Goddard added a comment -

        encode method is now delegating to the underlying object, but further testing shows that the object is stale.

        Show
        Ted Goddard added a comment - encode method is now delegating to the underlying object, but further testing shows that the object is stale.
        Ted Goddard made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Ted Goddard added a comment -

        Change checked in for ICE-6791 should resolve response staleness.

        Show
        Ted Goddard added a comment - Change checked in for ICE-6791 should resolve response staleness.
        Ken Fyten made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Affects [Compatibility/Configuration]
        Resolution Fixed [ 1 ]
        Hide
        Ted Goddard added a comment -

        Stale responses are no longer present during user interaction, but are present during Ajax Push. The proposed technique to resolve will be as follows:

        Create a Servlet Filter to inject a FailSafeResponseWrapper. This must be in the Filter chain prior to the Seam Filters. The FailSafeResponseWrapper will allow encode*() to proceed using the Seam wrapper on the stale HttpServletResponse.

        Show
        Ted Goddard added a comment - Stale responses are no longer present during user interaction, but are present during Ajax Push. The proposed technique to resolve will be as follows: Create a Servlet Filter to inject a FailSafeResponseWrapper. This must be in the Filter chain prior to the Seam Filters. The FailSafeResponseWrapper will allow encode*() to proceed using the Seam wrapper on the stale HttpServletResponse.
        Ted Goddard made changes -
        Attachment FailSafeResponseFilter.java [ 13285 ]
        Hide
        Ted Goddard added a comment -

        The attached FailSafeResponseFilter wraps the Response in a version that does not throw an Exception when it has gone out of request processing scope. It must be added to the web.xml prior to the Seam Filter:

        <filter>
        <filter-name>FailSafe</filter-name>
        <filter-class>FailSafeResponseFilter</filter-class>
        </filter>

        <filter-mapping>
        <filter-name>FailSafe</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>

        Since the specific failure seen by the customer has not been reproduced in the test application, the FailSafeResponseFilter contains substantial System.out output and is implemented in the default package so that it can be compiled directly within the "classes" directory or added to an existing project at the root level.

        Show
        Ted Goddard added a comment - The attached FailSafeResponseFilter wraps the Response in a version that does not throw an Exception when it has gone out of request processing scope. It must be added to the web.xml prior to the Seam Filter: <filter> <filter-name>FailSafe</filter-name> <filter-class>FailSafeResponseFilter</filter-class> </filter> <filter-mapping> <filter-name>FailSafe</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> Since the specific failure seen by the customer has not been reproduced in the test application, the FailSafeResponseFilter contains substantial System.out output and is implemented in the default package so that it can be compiled directly within the "classes" directory or added to an existing project at the root level.
        Hide
        Ted Goddard added a comment -

        Updated to include FailSafeRequestWrapper.

        Show
        Ted Goddard added a comment - Updated to include FailSafeRequestWrapper.
        Ted Goddard made changes -
        Attachment FailSafeResponseFilter.java [ 13290 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24781 Wed Jun 08 15:28:17 MDT 2011 ted.goddard Filter for insulating against stale requests/responses (ICE-6881)
        Files Changed
        Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/FailSafeResponseFilter.java
        Hide
        Ted Goddard added a comment -

        Configured via:

        <filter>
        <filter-name>FailSafe</filter-name>
        <filter-class>com.icesoft.faces.webapp.http.servlet.FailSafeResponseFilter</filter-class>
        </filter>

        <filter-mapping>
        <filter-name>FailSafe</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>

        Show
        Ted Goddard added a comment - Configured via: <filter> <filter-name>FailSafe</filter-name> <filter-class>com.icesoft.faces.webapp.http.servlet.FailSafeResponseFilter</filter-class> </filter> <filter-mapping> <filter-name>FailSafe</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: