It won't work that way, when using Ajax you must use Ajax to redirect to a login page. You can use something like this
http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/ so your interceptor must return 403 status code (it can return also an url to login page to redirect to) and you must handle redirect on client side Regards -- Ćukasz + 48 606 323 122 http://www.lenart.org.pl/ 2016-03-11 15:31 GMT+01:00 fea jabi <zy...@hotmail.com>: > Need help with this please. > > ________________________________________ > From: fea jabi <zy...@hotmail.com> > Sent: Wednesday, March 9, 2016 10:51 AM > To: user@struts.apache.org > Subject: struts2 interceptor session timeout with ajax > > Have jquery tabbed panel in a jsp page which has a button to Save the form in > the tabbed panel which is making an ajax call and is working fine. > > Now trying to implement the session management for all requests in the > application and imlemented the new interceptor to perform the same. Having > issue with session management with the ajax calls. Have the below package for > ajax requests in which configured the new interceptor created and the default > interceptor. But, the below is not redirecting to the login page instead > opening the popup with login page html in it. what am I missing here? > > <package name="ajax-default" extends="json-default" namespace="/ajax"> > > <interceptors> > > <interceptor class="com.xxx.LoginInterceptor" name="loginInterceptor"> > > </interceptor> > > <interceptor-stack name="appDefaultStack"> > > <interceptor-ref name="loginInterceptor" /> > > <interceptor-ref name="defaultStack" /> > > </interceptor-stack> > > </interceptors> > > <default-interceptor-ref name="appDefaultStack"></default-interceptor-ref> > > <action name="saveAJAXAction" class="com.xxx.descAction" method="saveDesc"> > > <result type="json" name="success"> > > <param name="noCache">true</param> > > <param name="excludeNUllProperties">true</param> > > <param name="root">jsonResult</param> > > </result> > > <result name="login" type="redirectAction"> > > <param name="actionName">appLogin</param> > > <param name="namespace">/</param> > > </result> > > </action> > > ........ > > </package> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org