Servlet Redirect in Ajax Request

Resolved :smiley:

Put this code into the client-side:
function requestUnauthorized(xhr) {
window.location.href = xhr.getResponseHeader(“Location”);
}
(function($) {
$.ajaxSetup({
statusCode: {
401: requestUnauthorized,
}
});
})(window.jQuery);

And all request can be redirect to another page.