j_security_check and Ajax call

Discussion in 'Java' started by Narendra Sisodiya, Aug 4, 2009.

  1. 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>
     
    Narendra Sisodiya, Aug 4, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sasha Borodin
    Replies:
    0
    Views:
    3,091
    Sasha Borodin
    Jul 28, 2003
  2. Aj-India

    location of j_security_check

    Aj-India, Apr 10, 2006, in forum: Java
    Replies:
    4
    Views:
    16,765
    Aj-India
    Apr 11, 2006
  3. minnie
    Replies:
    1
    Views:
    727
    Andrew Thompson
    Dec 13, 2006
  4. Nathan Sokalski
    Replies:
    2
    Views:
    498
    Nathan Sokalski
    Jun 2, 2007
  5. =?Utf-8?B?VG9u?=
    Replies:
    2
    Views:
    555
    =?Utf-8?B?VG9u?=
    Jun 22, 2007
Loading...

Share This Page