Redirect to login page onajax request
I am using jsp and jquery...and struts.I have a problem understanding the
redirect to login page for ajax request.I tried to see request on browser
on XHR tab and it gives me 302 status code in header.I am not able to
comprehend how do i redirect. My approach 1)The application has a function
which checks if the user is signed in or not and has function to redirect
to login url. 2)Else do some other processing.
How do I come back to same page after login.Is there any way?.....Also for
redirecting on server side i am using Response.redirect().When i debug the
code and response comes on client side the error function in ajax funcn is
executed not success function..Can someone explain how to catch response
from server?...
function buttonpress(param1,param2) {
$.ajax({
type:"GET",
data: {
X:param1,
Y:param2,
},
url:"/application",
success:function() {
alert("success message");
},
error:function() {
alert("error message");
}
});
}
No comments:
Post a Comment