PDA

View Full Version : How to handle "HTTP Error 302" in Extjs & PHP?



renganathan
3 Sep 2012, 9:46 PM
Hi All,

I am occasional getting HTTP Error 302 (because of session getting expired).

I want to handle this error by means of redirecting into index.php.

Can somebody guide me how to handle that?

tvanzoelen
4 Sep 2012, 12:08 AM
Is 302 an error? I think its a redirection that will serve a file.

To handle http requestexceptions



Ext.Ajax.on('requestexception',function(con, response, options){

//your code here

});

sword-it
4 Sep 2012, 11:05 PM
HI!

try requestexceptions or you may also handle it during your ajax request,
sample:-


Ext.Ajax.request ( {
url: 'Your URL',
success: function ( f, a ) {
// Success Function
},
failure: function ( f, a ) {
if ( a.response.status == 302) {
alert('302 redirection error')
}
}
});