That works in that my filter is called when the session times out and the user 
is redirected to the login page.  However, the Referer header makes no 
indication that the user is logging in.  In Jetty, the Referer header would be 
"/login.do".  This would indicate that the user is logging in.  If the request 
URI is not null, then I can redirect them to the requested URI if it has been 
determined that it is a "safe" area that does not need any session variables 
established.  Is there a way to determine if the user's session has timed out 
and the user is logging in once again?

--- rfha...@yahoo.com wrote:

From: Bob Hall <rfha...@yahoo.com>
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: Session Timeout - Filter Not Called
Date: Sun, 11 Apr 2010 22:52:37 -0700 (PDT)

Paul,

--- On Sun, 4/11/10, Paul Carroll <pcarr...@nfmail.net> wrote:

> I am using Tomcat 6.0 on Windows
> Server 2003.  It seems that when my session expires I
> am redirected to the login page which I would expect. 
> However, my filter is not called when I am redirected to the
> login page.  When I used Jetty as my web server, the
> call was intercepted by the filter before the user was
> presented the login page.  Does anyone know why this is
> the case?  The following is the sections of my web.xml
> that contains the filter info.
> 
> <filter>
>   <filter-name>SessionTimeoutFilter</filter-name>
>     <filter-class>com.mycompany.ui.filters.SessionTimeoutFilter</filter-class>
>       <init-param>
>         <param-name>home</param-name>
>         <param-value>/home.do</param-value>
>       </init-param>
>     </filter>
> 
>     <filter-mapping>
>       <filter-name>SessionTimeoutFilter</filter-name>
>       <servlet-name>action</servlet-name>
>     </filter-mapping>
> 
>     <servlet>
>       <servlet-name>action</servlet-name>
>       <servlet-class>com.mycompany.ui.web.ActionServlet</servlet-class>
>       <init-param>
>         <param-name>config</param-name>
>       </init-param>
>     </servlet>
>
>     <servlet-mapping> 
>       <servlet-name>action</servlet-name>
>       <url-pattern>*.do</url-pattern>
>     </servlet-mapping>
> 
> 
> My index.jsp contains 1 line which redirects to home.do.
> 

Your filter is mapped to <servlet-name> action which is mapped to <url-pattern> 
*.do

Don't know about Jetty, but you will probably get the behavior you expect if 
you change the <filter-mapping> element to use:
  <url-mapping>/*</url-mapping> (and remove <servlet-name>)

- Bob





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Reply via email to