jp.terasoluna.fw.web
Class HttpSessionListenerImpl

java.lang.Object
  extended by jp.terasoluna.fw.web.HttpSessionListenerImpl
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionListener

public class HttpSessionListenerImpl
extends java.lang.Object
implements javax.servlet.http.HttpSessionListener

Class that processes the life cycle events of HTTP session.

At the time of invalidaing the HTTP session, delete the directory linked to the session, if it exists.

Perform the settings in web.xml as shown below.

web.xml configuration example

 <listener>
   <listener-class>
     jp.terasoluna.fw.web.HttpSessionListenerImpl
   </listener-class>
 </listener>
 
For the generation and deletion process of session directory, refer to FileUtil.

See Also:
FileUtil

Constructor Summary
HttpSessionListenerImpl()
           
 
Method Summary
 void sessionCreated(javax.servlet.http.HttpSessionEvent event)
          Processes the creation event of HTTP session.
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
          Processes the invalidation event of HTTP session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSessionListenerImpl

public HttpSessionListenerImpl()
Method Detail

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent event)

Processes the creation event of HTTP session.

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener
Parameters:
event - Session event

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)

Processes the invalidation event of HTTP session.

Delete the directory linked to the session, if it exists.

Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener
Parameters:
event - Session event