![]() What happens it that the Ajax layer receives an HTTP 200 code after the redirection. According to the W3C specs, the redirection is taken care at browser level and should be transparent for the user (so transparent for the XMLHttpRequest protocol too). However, at the XMLHttpRequest level, it is not possible to detect this redirection. The same mechanism applies if the request is Ajax-based. If your resources is protected by a security framework any un-authenticated request will be rejected and the framework redirects you to a login page. The underlying implementation relies on Ajax calls to achieve content lazy loading. The corner-stone of mobile architecture are RESTfull webservices. Many companies provide a mobile interface of their traditional desktop website to address a larger audience. Nowadays mobile development is getting more and more important for the business. Please note that a demo application for this article can be found on GitHub Įdit: the implementation has been changed to simplify Ajax request detection thanks to Marty Jones suggestions. ![]() For those who don’t use Spring Security I’ll show another approach with servlet filter. ![]() In this article we’ll see a solution based on Spring Security filter. If you’re not familiar yet with Spring Security, you can check my previous articles on this framework. Recently when developing the Tatami application for the Twitter-like contest, I faced an annoying issue: how to detect an user session timeout when an Ajax request is triggered from the browser ?
0 Comments
Leave a Reply. |