Session Expire filter ver. 1.3

This is a Java servlet filter (as per Servlet API 2.3). This filter lets you redirect incoming requests with expired sessions to some specified URL.

How to use it:

a) download sessexpireflt.jar and save it in WEB-INF/lib

b) describe this filter in web.xml. You have to provide an initial parameter redirect described an URL for redirection. An optional parameter exclude describes a commas separated list of files where the session check is disabled (in other words being excluded from the protection schema).
 


<filter>
  <filter-name>SessionExpireFilter</filter-name>
  <filter-class>com.cj.sessexpire.SessionExpireFilter</filter-class>
  <init-param>
    <param-name>redirect</param-name>
    <param-value>your_page_for_expired_sessions</param-value>
  </init-param>
</filter>

c) describe a mapping for this filter in web.xml. E.g.:
 


<filter-mapping>
  <filter-name>SessionExpireFilter</filter-name>
  <url-pattern>*.jsp</url-pattern>
</filter-mapping>

in this example filter will be on for the each .jsp file. And now when some .jsp page (covered by SessionExpireFilter mapping) is requested filter may redirect (or forward) request to the specified URL. If target URL starts with http than request will be redirected. Otherwise filter assumes a local resource and forwards request.

   For downloading:

    Session Expire package:  sessexpireflt.jar
 

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.

Also in Coldtags: