前台:
Ext.Ajax.on('requestexception', function (conn, response, options) {
if (response.status == "timeout") {
Ext.Msg.alert('提示', '回话过期,请重新登录!', function () {
parent.location.href = __ctxPath + '/login.jsp';
});
}
});
后台:(在拦截器里进行处理)
if (request.getHeader("x-requested-with") != null && request.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")) {
response.addHeader("sessionstatus", "timeout");
} else {
filterChain.doFilter(request, response);
}