How to handle redirect 302 in extjs form submit
Before form is submit it go through session checking and if session was timeout it will redirect to login page. This is where the problem occur because it is ajax form submit so fa开发者_运维问答ilure: handle this, but what extjs return to separate redirect from other kind of error ?
If your session is timed out, do you need the server to return a json and handle it in the failure or success handler of the ajax request?
But if your session has expired, you need to redirect the user to your login page. In that case, you need not worry about what the json response would be and how ExtJS will handle it.
For a 302 error, its the web server that provides the alternate URL and not the browser. The 302 response from the Web server should always include an alternative URL to which redirection should occur. So, in your case you should redirect the user to the login page of your application.
精彩评论