<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "session timeout and redirection"]]></title>
		<link>http://jforum.icesoft.org/JForum/posts/list/25.page</link>
		<description><![CDATA[Latest messages posted in the topic "session timeout and redirection"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>session timeout and redirection</title>
				<description><![CDATA[ Hi,

I'm using lastest SVN  16805.

I setup the folowing lines into web.xml

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>	&lt;context-param&gt;
		&lt;param-name&gt;com.icesoft.faces.connectionLostRedirectURI&lt;/param-name&gt;
		&lt;param-value&gt;'/index.jsp'&lt;/param-value&gt;
	&lt;/context-param&gt;</pre>
		</div>

and

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
	&lt;session-config&gt;
		&lt;session-timeout&gt;1&lt;/session-timeout&gt;
	&lt;/session-config&gt;
</pre>
		</div>

So, when the minute is done, I get the following message and I don't have any redirection to the index.jsp file.

<blockquote>
19:42:01,628 ERROR [http.servlet.SessionDispatcher] java.lang.NullPointerException
19:42:01,629 ERROR [[localhost].[/].[Blocking Servlet]] "Servlet.service()" pour la servlet Blocking Servlet a généré une exception
java.lang.IllegalStateException: "getLastAccessedTime": Session déjà invalidée
	at org.apache.catalina.session.StandardSession.getLastAccessedTime(StandardSession.java:439)
	at org.apache.catalina.session.StandardSessionFacade.getLastAccessedTime(StandardSessionFacade.java:84)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:227)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:221)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifySessionInitialized(SessionDispatcher.java:110)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifyIfNew(SessionDispatcher.java:63)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:52)
	at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:595)
19:42:01,629 ERROR [[localhost].[/].[Blocking Servlet]] "Servlet.service()" pour la servlet Blocking Servlet a généré une exception
java.lang.IllegalStateException: "getLastAccessedTime": Session déjà invalidée
	at org.apache.catalina.session.StandardSession.getLastAccessedTime(StandardSession.java:439)
	at org.apache.catalina.session.StandardSessionFacade.getLastAccessedTime(StandardSessionFacade.java:84)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:227)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:221)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifySessionInitialized(SessionDispatcher.java:110)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifyIfNew(SessionDispatcher.java:63)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:52)
	at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:595)
19:42:01,631 ERROR [[localhost].[/].[Blocking Servlet]] "Servlet.service()" pour la servlet Blocking Servlet a généré une exception
java.lang.IllegalStateException: "getLastAccessedTime": Session déjà invalidée
	at org.apache.catalina.session.StandardSession.getLastAccessedTime(StandardSession.java:439)
	at org.apache.catalina.session.StandardSessionFacade.getLastAccessedTime(StandardSessionFacade.java:84)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:227)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.<init>(SessionDispatcher.java:221)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifySessionInitialized(SessionDispatcher.java:110)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.notifyIfNew(SessionDispatcher.java:63)
	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:52)
	at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:595)

&nbsp;
		</blockquote>
Do you have ideas for solving this redirection problem ?

thanks for your help and advice.

regards,

Bal.]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#35933</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#35933</link>
				<pubDate><![CDATA[Thu, 5 Jun 2008 12:34:50]]> GMT</pubDate>
				<author><![CDATA[ Baleyba]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ I'm using svn 16846 ]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#36115</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#36115</link>
				<pubDate><![CDATA[Wed, 11 Jun 2008 04:15:39]]> GMT</pubDate>
				<author><![CDATA[ Baleyba]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ Hi,

With the day svn revision: 16871

Now I'm just getting this following line:

<blockquote>
15:19:50,832 ERROR [http.servlet.SessionDispatcher] java.lang.NullPointerException&nbsp;
		</blockquote>

And the session timeout redirection don't work

regards,

Bal]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#36177</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#36177</link>
				<pubDate><![CDATA[Thu, 12 Jun 2008 08:21:50]]> GMT</pubDate>
				<author><![CDATA[ Baleyba]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ A few things here:

1. You need to have an ice:outputConnectionStatus component on your page in order for the &quot;connectionLostRedirectURI&quot; parameter to work.

2. There was a number of regression bugs in the code over the last week or so that may have been affecting your redirect behvior negatively. Our testing shows that these are resolved as of last night, so rev. #16871 should be working okay.

Can you confirm that you're using the latest code =&gt rev. #16871 and also have the ice:outputConnectionStatus component on your page? Is your application using asynchronous update mode (default)?

Regards, 
 Ken]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#36217</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#36217</link>
				<pubDate><![CDATA[Thu, 12 Jun 2008 15:03:08]]> GMT</pubDate>
				<author><![CDATA[ ken.fyten]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ One more thing:  com.icesoft.faces.connectionLostRedirectURI doesn't apply to session expiry at all, it's only used if the connection is actually lost through an unexpected connectivity failure.

Regards,
  Ken]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#36225</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#36225</link>
				<pubDate><![CDATA[Thu, 12 Jun 2008 15:59:17]]> GMT</pubDate>
				<author><![CDATA[ ken.fyten]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ i use the connectionLostRedirectURI param with this:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre> &lt;error-page&gt;
        &lt;exception-type&gt;com.icesoft.faces.webapp.http.core.SessionExpiredException&lt;/exception-type&gt;
        &lt;location&gt;/index.jsp&lt;/location&gt;
    &lt;/error-page&gt;</pre>
		</div>

And works pretty nice.. when session is invalidate or is finished by timeout the application go to index.jsp]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#36229</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#36229</link>
				<pubDate><![CDATA[Thu, 12 Jun 2008 17:37:14]]> GMT</pubDate>
				<author><![CDATA[ Marioko]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ hi ken.fyten and Marioko,

ken.fyten> Yes, I'm using the ice:outputConnectionStatus component.

Now I'm using last rev.: 16912 and yes my application is using asynchronous update mode.

Thanks for solving this bug: http://jira.icefaces.org/browse/ICE-3095 => Now I don't get the exception when session expires. But always no redirection to the login page... :(

Marioko>I tried you solution, but it doesn't work in my project :(

I'm always getting this status when session is expiring...<img src="http://component-showcase.icefaces.org/component-showcase/xmlhttp/css/xp/css-images/connect_disconnected.gif" border="0"> and no redirection.


Thanks for your answers 

best regards,
Bal.]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#36436</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#36436</link>
				<pubDate><![CDATA[Tue, 17 Jun 2008 09:42:27]]> GMT</pubDate>
				<author><![CDATA[ Baleyba]]></author>
			</item>
			<item>
				<title>Re:session timeout and redirection</title>
				<description><![CDATA[ There's a dirty <a href="http://www.icefaces.org/JForum/posts/list/2281.page" target="_new" rel="nofollow">workaround</a> that we're still using to get a redirection after the session is gone:

web.xml:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
     &lt;context-param&gt;
         &lt;param-name&gt;com.icesoft.faces.connectionLostRedirectURI&lt;/param-name&gt;
         &lt;param-value&gt;'expired.jsp'&lt;/param-value&gt;
     &lt;/context-param&gt;
</pre>
		</div>

We use this on Glassfish, so we need a expired.jsp in every subfolder, because ICEfaces/Glassfish doesn't allow to use an absolute path here, like '/expired.jsp' (that's the dirty part ;-)). You may use an "absolute path" or "context root relative path" instead with another appserver.

expired.jsp
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
&lt;%@page contentType="text/html" pageEncoding="utf-8"%&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"&gt;

&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
        &lt;title&gt;Session Expired&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
&lt;% 
  if &#40;session!=null&#41; {
    session.invalidate&#40;&#41;; 
  }
  response.sendRedirect&#40;"../error.xhtml"&#41;; 
%&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
		</div>

We use an error page that is based on ICEfaces/Facelets here. So, the relative path from the redirect statement has to change dependent on the sub folder the jsp resides.

This solution shows the error.xhtml with every exception, session timeout, etc. Sometimes it is possible to choose the browser's page back button to have a look at an exception message.

Maybe this helps until we get a standards conforming solution ;-).]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/list/8605.page#37570</guid>
				<link>http://jforum.icesoft.org/JForum/posts/list/8605.page#37570</link>
				<pubDate><![CDATA[Wed, 9 Jul 2008 03:10:08]]> GMT</pubDate>
				<author><![CDATA[ rainwebs]]></author>
			</item>
	</channel>
</rss>
