Re: Redirection afer ajax call when session timeout.

2013-09-19 Thread Lenny Primak
pache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:77) > > > > -Message d'origine----- > De : Lenny Primak [mailto:lpri...@hope.nyc.ny.us] > Envoyé : mercredi 18 septembre 2013 17:46 > À : Tapestry users > Objet : Re: Redirection afer a

RE: Redirection afer ajax call when session timeout.

2013-09-19 Thread ANDRE Christophe
ultModules(IOCUtilities.java:77) -Message d'origine- De : Lenny Primak [mailto:lpri...@hope.nyc.ny.us] Envoyé : mercredi 18 septembre 2013 17:46 À : Tapestry users Objet : Re: Redirection afer ajax call when session timeout. FlowLogix library takes care of this with the @AJAX ann

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Geoff Callender
I don't think that piece of JavaScript will do it for T5.3. Try the technique found here instead: http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/protectingpages or go with FlowLogix. 2013/9/19 ANDRE Christophe > Thx, that's really interresting. > But then how to know

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Lenny Primak
FlowLogix library takes care of this with the @AJAX annotation. http://code.google.com/p/flowlogix/wiki/TLAJAXAnnotation SNAPSHOT release is available for T5.4 On Sep 18, 2013, at 9:48 AM, ANDRE Christophe wrote: > I tried with href but same thing. > > Yes the method is called (checked with

RE: Redirection afer ajax call when session timeout.

2013-09-18 Thread ANDRE Christophe
Thx, that's really interresting. But then how to know the session (Spring) has expired? Even when the session spring has expired when I test session.isInvalidated() returns false? public boolean dispatch(Request request, Response response) throws IOException { Session session = request

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Eugen
if the client should be redirected on an event (click) after timeout happen, You can try to contribute the MasterDispatcher to do a refresh (or a redirect) if session not exists. See http://stackoverflow.com/questions/3733277/session-timeout-ajax-error-in-tapestry-application 2013/9/18 ANDRE Chris

RE: Redirection afer ajax call when session timeout.

2013-09-18 Thread ANDRE Christophe
I tried with href but same thing. Yes the method is called (checked with firebug). But nothing happens. I don't know if this has to do with it, but I got the same kind of weird behavior when I do a javascript callback to show an alert from a java applet. The method is called but the alert is nev

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Michael Gagauz
It's hard to tell why... Try to debug js code - is it called or not. But this sample is real one, I use it in several projects. 18.09.2013 17:23, ANDRE Christophe пишет: I tryed with this: $(document).ajaxComplete(function(event, xhr, options){ if (xhr&& xhr.getResponseHeader("Locati

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Eugen
try window.location.href = xhr.getResponseHeader("Location"); 2013/9/18 ANDRE Christophe : > I tryed with this: > > > > $(document).ajaxComplete(function(event, xhr, options){ > > if (xhr && xhr.getResponseHeader("Location")) { > > window.location = xhr.getResponseHeader("Location");

RE: Redirection afer ajax call when session timeout.

2013-09-18 Thread ANDRE Christophe
I tryed with this: $(document).ajaxComplete(function(event, xhr, options){ if (xhr && xhr.getResponseHeader("Location")) { window.location = xhr.getResponseHeader("Location"); } }); When I look at the request I get the following : 00:02:29.263 0.073 2319

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Eugen
Hi, another option is to manage the Timeout in Javascript on each render of the layout component Yout pass to a Javascript function the maxInactiveInterval of the session and on Javascript side starts an Timer with count down function. When the maxInactiveInterval value is 0, a window.location.href

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Michael Gagauz
Another options to return from page/component event: 1. Link object 2. String with page url 3. JSON containing {redirectURL:"/desired/location"} 18.09.2013 16:22, ANDRE Christophe пишет: Hi, I have an application that use a lot of Ajax. When my session has expired, my server redirect me on my d

Re: Redirection afer ajax call when session timeout.

2013-09-18 Thread Michael Gagauz
If you're using jquery add following code to the page: $j(document).ajaxComplete(function(event, xhr, options){ if (xhr && xhr.getResponseHeader("Location")) { window.location = xhr.getResponseHeader("Location"); } }); 18.09.2013 16:22, ANDRE Christophe пишет: Hi, I have an app