j_security_check and Ajax call

  • Thread starter Narendra Sisodiya
  • Start date
N

Narendra Sisodiya

Hi all,
I have one application which use jsp. It has login page which use
j_security_check for login purpose.
as per my knowledge m j_security_check redirect to all accessed or
called get/post request.
If i open application in two tab in firefox then I will get a ajax
call problem.

Open application in two tabs
tab 1 : logout for one tab. login page will come up.
tab 2 : other tab will still making ajax calls to server.
tab 1 : When I make a login , it now redirect to ajax call because it
is the last accessed request was a ajax request.

I do not want my login to website is redirected to ajax call pages
which are notinh but some xml datas. How can i do this??
the temoporary solution for this is to make a ajax call to desired
page while login

Ex


+ function ajaxCalltoWelcomePage(){
+ var xmlhttp=null;
+ if (window.XMLHttpRequest){// code for all new browsers
+ xmlhttp=new XMLHttpRequest();
+ }
+ else if (window.ActiveXObject){// code for IE5 and IE6
+ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if (xmlhttp!=null){
+ xmlhttp.open("GET","welcome.jsp",true);
+ xmlhttp.send(null);
+ }else{
+ alert("Your browser does not support XMLHTTP.");
+ }//ifelse
+ }//function
+</script>


+ <form name="Login" action="j_security_check"
onSubmit="ajaxCalltoWelcomePage()" method=post>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top