You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Schulte Marcus <ma...@bmw.ch> on 2006/06/01 08:09:13 UTC

RE: Cleanup when the session expires

you can use javax.servlet.http.HttpSessionAttributeListener instead.
You have to register the class in web.xml
hth, Marcus

> -----Original Message-----
> From: Christian Surlykke [mailto:cpet@dsb.dk]
> Sent: Tuesday, May 30, 2006 10:52 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Cleanup when the session expires
> 
> 
> Hi
> 
> Sorry if this has been asked before.
> 
> Under tapestry 3.0 I had some resources attached to my visit 
> object that 
> I needed to release on session expiration. I did something like:
> 
> public class MyEngine extends BaseEngine implements 
> HttpSessionBindingListener{
>     public void valueUnbound(HttpSessionBindingEvent arg0) {
>         ((MyVisit) getVisit()).cleanup();
>     }
> 
>     public void valueBound(HttpSessionBindingEvent arg0) {
>     }
> }
> 
> Under tapestry 4.0 this no longer works. The javadoc for 
> EngineManager 
> claims that if the engine is 'stateful' it will be stored in the 
> httpsession, but reading the code for EngineManager and its 
> implementation I could not confirm this. (Might be because of 
> my lack of 
> understanding...)
> 
> Is there a recommended way to handle cleanup when the session is 
> invalidated?
> 
> 
> best regards
> 
> 
> Christian Surlykke
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org