Ajax请求Session超时的处理
1、客户端的js处理(使用jqury) <script type="text/javascript"> //<![CDATA[ $(document).ajaxComplete(function(event, xhr, settings) { if(xhr.getResponseHeader("sessionstatus")=="timeOut"){ if(xhr.getResponseHeader("loginPath")){ window.location.replace(xhr.getResponseHeader("loginPath")); }else{ alert("Request time out relogin plase !"); } } }); //]]> </script> 2、服务器端处理(filter中) if(sessionTimeOut){ //判断是否为ajax请求 if (httpRequest.getHeader("x-requested-with") != null && httpRequest.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")) { HttpServletResponse httpResponse = (HttpServletResponse