Since you have done this: session.removeAttribute(AppModule.USER_LOGGED_IN)

All you need to do is implement a small dispatcher to check for it in state, 
contribute your dispatcher to AppModule, and redirect from within it. Your 
dispatcher would require the ApplicationStateManager and Request services as 
dependencies. RequesFilters/Dispatchers are pipelined, which means they are 
chained and execute in an ordered way. 

Cheers,
Peter

----- Original Message -----
From: "kamath_svk" <kamath...@yahoo.co.in>
To: users@tapestry.apache.org
Sent: Wednesday, 22 September, 2010 12:31:11 GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: SendRedirect is giving NullPointerException


Hi,

I found a site for session handling using Tapestry5.
http://eubauer.de/kingsware/2010/02/04/track-login-and-logout-of-users-with-tapestry-5/
 

when ever session is destroyed, sessionDestroyed() method in
SessionListener[user-defined] class which is added in services package of
tapestry is automatically called.

can any one tell me how to redirect the browser to a default page ?
if i had response object i could have redirected to some page but that
method doesn't contain response object.

i have added the code for SessionListener class.

public class SessionListener implements HttpSessionListener {
        public void sessionCreated(HttpSessionEvent se) {
                // Do nothing
        }

        public void sessionDestroyed(HttpSessionEvent se) {
                System.out.println(" *      Session is destroyed      *  ");
                HttpSession session = se.getSession();
                Principal principal = (Principal)
session.getAttribute(AppModule.USER_LOGGED_IN);
                session.removeAttribute(AppModule.USER_LOGGED_IN);
                // Do some stuff here...
        }
} 
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/SendRedirect-is-giving-NullPointerException-tp2843561p2849405.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
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