here's how we implement logout in a listener - works for us..
public void logoutUser(IRequestCycle cycle) {
getPage().getEngine().setVisit(null);
try {
HttpSession session =
cycle.getRequestContext().getSession();
if (session != null) {
session.invalidate();
}
} catch (IllegalStateException ex) {
}
// make sure to include the application context in effect in the
redirection URL
String contextPath =
cycle.getRequestContext().getRequest().getContextPath();
throw new RedirectException(contextPath +
"/app?service=page/Logout");
}
On 8/31/05, LOCHART,DOUGLAS E <[EMAIL PROTECTED]> wrote:
> Geoff,
>
> When I looked over the Stack Trace it appears as though
> the session this page rendering belonged too is alive. In
> the tapestry Exception page it says that Session.isNew()
> is NO. Then it contniues the process until it gets into
> the Visit Object which I clear during Logout.
>
> Could it be that my logout mechanism is not working? I
> used to do this:
>
> Visit visit = (Visit)getVisit();
> visit.clear();
> try {
> ((IEngineServiceView)getEngine()).restart( cycle );
> }catch(Exception e) {
> _logger.warn("Logout Exception: Ignoring ... ",e);
> }
>
> Then I read a posting that you should not do this in a
> listener and they proposed using the restart service
> directly. I could not find an example of this so I tried
> the following:
>
> Visit visit = (Visit)getVisit();
> visit.clear();
> IEngineService pageService =
> cycle.getEngine().getService(Tapestry.RESTART_SERVICE);
> String pageName =
> cycle.getPage().getExtendedId();
> String redirector = pageService.getLink(cycle,
> null, new String[0]).getURL();
> throw new RedirectException(redirector);
>
>
> I now do this. Both seem to work for me for the most
> part. But the first time I saw this problem It was an
> overnight thing and the Logout code was not involved. The
> Session should have timed out. I do NOT have any fancy
> ajax stuff that pings to keep the session alive either.
>
> Doug
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]