1 Reply Latest reply on Feb 21, 2005 1:21 PM by Scott Stark

    Urgent: Form based Authentication asking twice to authentica

    bhupesh reddy Newbie


      I have a loginServlet and i am doing a response.sendRedirect. something like

      if (responseCode == 302)
       response.sendRedirect(contextPath + "/login.jsp");
       response.sendRedirect(contextPath + "/login.jsp?status=\"error\"");

      In login.jsp we are doing

       if(request.getRemoteUser() != null){

      When i try to login to the application by giving the http://localhost:8080/test/login.jsp page, it is working fine. I am redirected to welcome page if username and password are correct or else redirected to the same login page.

      The problem is that when i give the url as http://localhost:8080/test/ say http://localhost:8080/test/welcome.jsp then first the login page is displayed ( which is correct ). when i give the correct username and password also, again the same login page is displayed. I have to refresh the page to go to the welcome page.
      Why is it behaving in such a way. and most importantly what is the solution to over this problem. (without using META tag in my JSP).

      Please respond immediately as it is very urgent.

      Thanks in advance,