You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nick Westgate <ni...@key-planning.co.jp> on 2005/09/01 04:22:27 UTC
Re: Form Submission on a Stale Session
Hi Douglas.
I presume you are using
-Dorg.apache.tapestry.disable-caching=true
or similar for development.
Try running your app without this, i.e. in production mode.
I've seen exceptions in dev mode that don't happen in production.
Cheers,
Nick.
LOCHART,DOUGLAS E wrote:
> Geoff,
>
> I changed our logout procedure to match yours and then tried the same
> excerice and got the same Exception.
>
> Doug
>
>>
>> -------------------
>>
>> 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 <do...@cablespeed.com> 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: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>
>>
>>
>> -- 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: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org