> I don't use @SessionState with my HttpSessionBindingListener  
> implementation. I set it in the Session directly. ;)

Exactly, just set it in your web.xml:

  <listener-class>
                        com.web.application.SessionListener
                </listener-class>

And then in SessionListener:

/** @see HttpSessionListener#sessionCreated(HttpSessionEvent) */
        public void sessionCreated(HttpSessionEvent event) {
                Logger.getLogger(getClass()).info(
                                        "Session created with id: " + 
event.getSession().getId());
        }

        /** @see HttpSessionListener#sessionDestroyed(HttpSessionEvent) */
        public void sessionDestroyed(HttpSessionEvent event) {
          //your logic here
       }


and bobs your uncle!
Peter

-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.

----- Original Message -----
From: "Thiago H. de Paula Figueiredo" <thiag...@gmail.com>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Friday, 15 January, 2010 16:44:28 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Handling session expiry

On Fri, 15 Jan 2010 12:40:24 -0200, Massimo Lusetti <mluse...@gmail.com>  
wrote:

> On Fri, Jan 15, 2010 at 3:34 PM, Thiago H. de Paula Figueiredo
> <thiag...@gmail.com> wrote:
>
>> T5 doesn't, but the Servlet API has. Create an  
>> HttpSessionBindingListener
>> implementation and add it to the Session. Its valueUnbound() method  
>> will be
>> invoked when the session is invalidated.
>
> Actually HttpSessionBindingListener.valueUnbound() Notifies the object
> that it is being unbound from a session and identifies the session, so
> due to the way T5 use the session with @SessionState object I would
> play carefully with it :)

I don't use @SessionState with my HttpSessionBindingListener  
implementation. I set it in the Session directly. ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


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

Reply via email to