ICEfaces
  1. ICEfaces
  2. ICE-3186

auto navigate on session-timeout does not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Any
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial

      Description

      Using this:
           <error-page>
               <exception-type>com.icesoft.faces.webapp.http.core.SessionExpiredException</exception-type>
               <location>/index.jsp</location>
           </error-page>

      I have tried this using sync and async, and tested on 1.7.1 build 2, 1.7.0, and 1.6.2.

        Issue Links

          Activity

          Jacky Lee created issue -
          Ken Fyten made changes -
          Field Original Value New Value
          Fix Version/s 1.7.1 [ 10122 ]
          Assignee Priority P1
          Assignee Greg Dick [ greg.dick ]
          Hide
          Ken Fyten added a comment -

          Greg notes:

          That wont work. The way the error code stuff works is that if the request throws an exception, the servlet container fetches the appropriate file and serves up the response including the contents of the file.

          This bit in web.xml

          <error-page>
          <exception-type>java.lang.Exception</exception-type>
          <location>/error.html</location>
          </error-page>

          causes this type of response to be sent to the browser:

          HTTP/1.1 500 java.lang.RuntimeException
          Server: Apache-Coyote/1.1
          ETag: W/"278-1209424220000"
          Last-Modified: Mon, 28 Apr 2008 23:10:20 GMT
          Content-Type: text/html
          Content-Length: 278
          Date: Thu, 05 Jun 2008 15:23:45 GMT
          Connection: close

          <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
          <title>Insert title here</title>
          </head>
          <body>
          Something bad happened.
          </body>
          </html>[52.659103s]
          HTTP/1.1 200 OK
          Server: Apache-Coyote/1.1
          Content-Length: 0
          Date: Thu, 05 Jun 2008 15:23:45 GMT

          For this to work, the exception has to be thrown to the servlet container, and the servlet container fetches the resource and serves it up all in one motion.

          The framework doesn't throw sessionExpired exceptions. The framework and bridge engage in a protocol to shut down the bridge instance and dipose of the views.

          Show
          Ken Fyten added a comment - Greg notes: That wont work. The way the error code stuff works is that if the request throws an exception, the servlet container fetches the appropriate file and serves up the response including the contents of the file. This bit in web.xml <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.html</location> </error-page> causes this type of response to be sent to the browser: HTTP/1.1 500 java.lang.RuntimeException Server: Apache-Coyote/1.1 ETag: W/"278-1209424220000" Last-Modified: Mon, 28 Apr 2008 23:10:20 GMT Content-Type: text/html Content-Length: 278 Date: Thu, 05 Jun 2008 15:23:45 GMT Connection: close <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> Something bad happened. </body> </html> [52.659103s] HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Length: 0 Date: Thu, 05 Jun 2008 15:23:45 GMT For this to work, the exception has to be thrown to the servlet container, and the servlet container fetches the resource and serves it up all in one motion. The framework doesn't throw sessionExpired exceptions. The framework and bridge engage in a protocol to shut down the bridge instance and dipose of the views.
          Hide
          Greg Dick added a comment -

          Currently, SessionExpiredExceptions are used to pass control back up the calling chain to the MainSessionBoundServlet when an IllegalStateException is thrown at some point in the framework. This exception is then used to generate the <session-expired> response for the browser, which is handled by the command handler in the bridge to dispose views and clean itself up.

          This potentially could be done by defining a context param (It can't be the <error-code> element because those aren't exposed to the servlet) that was to be included with the <session-expiry> command in order for the bridge to dispose of the views, and perhaps navigate to the session expiry page? Then we have to hope that it's a .jsp that doesn't have any icefaces components so an endless session loop is avoided.

          Show
          Greg Dick added a comment - Currently, SessionExpiredExceptions are used to pass control back up the calling chain to the MainSessionBoundServlet when an IllegalStateException is thrown at some point in the framework. This exception is then used to generate the <session-expired> response for the browser, which is handled by the command handler in the bridge to dispose views and clean itself up. This potentially could be done by defining a context param (It can't be the <error-code> element because those aren't exposed to the servlet) that was to be included with the <session-expiry> command in order for the bridge to dispose of the views, and perhaps navigate to the session expiry page? Then we have to hope that it's a .jsp that doesn't have any icefaces components so an endless session loop is avoided.
          Ken Fyten made changes -
          Fix Version/s 1.7.1 [ 10122 ]
          Assignee Priority P1
          Assignee Greg Dick [ greg.dick ]
          Hide
          Ken Fyten added a comment -

          This syntax for redirecting on session expired exception can't be readily supported, as explained above:

          <error-page>
          <exception-type>java.lang.Exception</exception-type>
          <location>/error.html</location>
          </error-page>

          We should create some tutorials that illustrates supported mechanisms for navigating to a specific page upon session expiry (sync. and async).

          Show
          Ken Fyten added a comment - This syntax for redirecting on session expired exception can't be readily supported, as explained above: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.html</location> </error-page> We should create some tutorials that illustrates supported mechanisms for navigating to a specific page upon session expiry (sync. and async).
          Ken Fyten made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Won't Fix [ 2 ]
          Ken Fyten made changes -
          Resolution Won't Fix [ 2 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Affects [Sample App./Tutorial]
          Assignee Priority P2
          Assignee Mircea Toma [ mircea.toma ]
          Ken Fyten made changes -
          Fix Version/s 1.7.2 [ 10130 ]
          Affects Version/s 1.6 [ 10031 ]
          Affects Version/s 1.7 [ 10080 ]
          Affects Version/s 1.6.2 [ 10111 ]
          Affects Version/s 1.7.1 [ 10122 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #16952 Fri Jun 20 12:08:49 MDT 2008 mircea.toma ICE-3186 Invoke DisposableBean.dispose() methods before anything else when shutting down the session bound server.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MainSessionBoundServlet.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #16953 Fri Jun 20 12:09:59 MDT 2008 mircea.toma ICE-3186 Invoke DisposableBean.dispose() methods before anything else when shutting down the session bound server.
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MainSessionBoundServlet.java
          Hide
          Mircea Toma added a comment -

          Invoke DisposableBean.dispose() methods before anything else when shutting down the session bound server.

          Show
          Mircea Toma added a comment - Invoke DisposableBean.dispose() methods before anything else when shutting down the session bound server.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Mircea Toma added a comment -

          I am attaching a sample webapp that achieves the redirect on session expiry functionality.

          Show
          Mircea Toma added a comment - I am attaching a sample webapp that achieves the redirect on session expiry functionality.
          Mircea Toma made changes -
          Attachment redirectonexpiry.zip [ 11086 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #16976 Sat Jun 21 06:04:28 MDT 2008 mircea.toma ICE-3186 Redirect on session expiry.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/status.js
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
          Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/application.js
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/outputconnectionstatus/OutputConnectionStatusRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #16977 Sat Jun 21 06:08:16 MDT 2008 mircea.toma ICE-3186 Redirect on session expiry.
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/bridge/src/application.js
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/outputconnectionstatus/OutputConnectionStatusRenderer.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/bridge/src/status.js
          Hide
          Mircea Toma added a comment -

          Add redirection on session expiry functionality for application developer's convenience. The way it would be configured should be similar to redirection on connection lost feature.

          Show
          Mircea Toma added a comment - Add redirection on session expiry functionality for application developer's convenience. The way it would be configured should be similar to redirection on connection lost feature.
          Mircea Toma made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Mircea Toma made changes -
          Affects [Sample App./Tutorial] [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial]
          Hide
          Mircea Toma added a comment -

          Redirect on session expiry. Now the redirect works also in synchronous mode.

          Show
          Mircea Toma added a comment - Redirect on session expiry. Now the redirect works also in synchronous mode.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Mircea Toma added a comment -

          'com.icesoft.faces.sessionExpiredRedirectURI' context parameter introduced to specify the redirection URI on session expiry.

          Show
          Mircea Toma added a comment - 'com.icesoft.faces.sessionExpiredRedirectURI' context parameter introduced to specify the redirection URI on session expiry.
          Ken Fyten made changes -
          Link This issue blocks ICE-3232 [ ICE-3232 ]
          Ken Fyten made changes -
          Security Private [ 10001 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-3106 [ ICE-3106 ]
          Hide
          Jacky Lee added a comment -

          the fix is broken on 1.7 branch at revision 17030

          Show
          Jacky Lee added a comment - the fix is broken on 1.7 branch at revision 17030
          Jacky Lee made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Mircea Toma added a comment -

          Tested successfully with 1.7 branch.

          Show
          Mircea Toma added a comment - Tested successfully with 1.7 branch.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Cannot Reproduce [ 5 ]
          Hide
          Deryk Sinotte added a comment -

          Investigate and verify

          Show
          Deryk Sinotte added a comment - Investigate and verify
          Deryk Sinotte made changes -
          Assignee Mircea Toma [ mircea.toma ] Greg Dick [ greg.dick ]
          Hide
          Greg Dick added a comment -

          I have an application that this works in. It successfully navigates to my configured page on session timeout. My test application has the following:

          <context-param>
          <param-name>com.icesoft.faces.sessionExpiredRedirectURI</param-name>
          <param-value>'sessionExpired.jsp'</param-value>
          </context-param>

          and I do have the connection status indicator on the page.

          Show
          Greg Dick added a comment - I have an application that this works in. It successfully navigates to my configured page on session timeout. My test application has the following: <context-param> <param-name>com.icesoft.faces.sessionExpiredRedirectURI</param-name> <param-value>'sessionExpired.jsp'</param-value> </context-param> and I do have the connection status indicator on the page.
          Ken Fyten made changes -
          Resolution Cannot Reproduce [ 5 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Priority P2
          Assignee Greg Dick [ greg.dick ]
          Ken Fyten made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Tiberiu Benedek added a comment -

          I am working with icefaces 1.7.2 SP1.

          <context-param>
          <param-name>com.icesoft.faces.synchronousUpdate</param-name>
          <param-value>true</param-value>
          </context-param>

          <context-param>
          <param-name>com.icesoft.faces.sessionExpiredRedirectURI</param-name>
          <param-value>sessionExpired.jsp</param-value>
          </context-param>

          This does NOT work in synchronous mode. It only works on asynchronous mode.

          Show
          Tiberiu Benedek added a comment - I am working with icefaces 1.7.2 SP1. <context-param> <param-name>com.icesoft.faces.synchronousUpdate</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.icesoft.faces.sessionExpiredRedirectURI</param-name> <param-value>sessionExpired.jsp</param-value> </context-param> This does NOT work in synchronous mode. It only works on asynchronous mode.

            People

            • Assignee:
              Unassigned
              Reporter:
              Jacky Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: