views:

59

answers:

0

HI we are using spring MVC as our application framework and in one of our modules we need to make an ajax request from one of the jsp's based on the response from the controller we need to redirect to another page.

 $.ajax({
        type: 'POST',
        dataType:'text',
        async: false,
        url: "${requestContextPath}/home.htm?t", 
        data: $("#Homepage").serialize(),
        success: function(data) {                     
            window.location.href = "${requestContextPath}/home.htm?t = "+sessionToken.redirect;                       
        }   
    });
    return false;
  });

this is the jquery which i have tried for this functionality but after getting back the response i'm not able to redirect to a new page. please help me on this