At the beginning, the code is like this:
$.ajax({
Type : "POST",
Url : sSource,
Cache : false,
dataType : "json",
Data : aoData,
Success : function(resp) {
Alert(11)
fnCallback(resp);
$.dialog.tips(‘Data loaded ‘, 1, ‘success.gif‘, function() { });
}
});
Spring-security session timeout, the query button can still click, and did not jump, observed that this method has problems.
Knowing more about the use of Ajax requests, the problem is that the request is in JSON format, and after the spring-security session expires, the redirected login page is returned, so we know what to do.
The reason is not complex, the solution is simple,---added error handling methods, problem solving!
,
Error: function (XMLHttpRequest, textStatus, errorThrown) {
/* alert(textStatus)// here is parseFailue
Alert(errorThrown) // This shows that the parsing json error is
Alert(XMLHttpRequest) */
responseText = XMLHttpRequest.responseText
// alert ( responseText )
Document.write(responseText); //
},
Complete: function (XMLHttpRequest, textStatus) {
}
Keep it down!
Fix spring-security Session Timeout Ajax request no redirect issue