1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    178
    Vote Rating
    2
    Answers
    4
    renganathan is on a distinguished road

      0  

    Default Answered: How to handle "HTTP Error 302" in Extjs & PHP?

    Answered: How to handle "HTTP Error 302" in Extjs & PHP?


    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?
    Thanks,

    RENGANATHAN M G

  2. Is 302 an error? I think its a redirection that will serve a file.

    To handle http requestexceptions

    Code:
    Ext.Ajax.on('requestexception',function(con, response, options){
               
                 //your code here
    
            });

  3. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,120
    Vote Rating
    30
    Answers
    85
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    Is 302 an error? I think its a redirection that will serve a file.

    To handle http requestexceptions

    Code:
    Ext.Ajax.on('requestexception',function(con, response, options){
               
                 //your code here
    
            });

  4. #3
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    Answers
    124
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    HI!

    try requestexceptions or you may also handle it during your ajax request,
    sample:-
    Code:
    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')
           }
       } 
    });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 2

Tags for this Thread