Thanks for the reply! I'm a little unclear about using the header result and the javascript callback.
So I define a specific result for ajax actions and use the header type where I define my own status code. Which will then be processed on the client side. I'm using the ajax theme with my struts tags, based on the struts 2 tutorial, to implement ajax functionality. Where can I define my code to catch the result and perform a redirect? I apologize for my inexperience. I'm a little unclear on how to Jeromy Evans - Blue Sky Minds wrote: > > Grish wrote: >> Is there a way to intercept these ajax actions and properly direct my >> users >> to the login page? Or is my approach fundamentally wrong? Any >> suggestions? >> > > You can only force the redirect to a login page from the client-side. > > There's a couple of ways you can do this: > - the interceptor can detect that the request is ajax either by the > partitioning of your packages/URLs or by inspecting the http header; > - return a custom http header when its an ajax request and > unauthorized (eg. return a 2xx or 4xx with a custom X-param). See the > headers result type. > - in your javascript callback, detect the odd result and perform a > redirect > > Hope that helps. > > Jeromy Evans > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Interceptors-with-Ajax-Actions-tp15706322p15706535.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]