Hi all,
I've a problem with request forward.
1) I have a
servlet which authenticates the user and forwards the request & response to some page that accepts cookies. This works fine for the fist time and if I logout and try to login (in the same browser instance), authentication happens in the servlet but the forward doest seem to work and throws back to the same login page.
Code snippet:
String strURL="/"+redirectURL;
RequestDispatcher rd = getServletContext().getContext("/").getRequestDispatcher(strURL);
rd.forward(request, response);
2) The same works fine when the response is written
StringBuffer successpage=new StringBuffer();
// script to submit the form when the body loads
successpage.append("& ltform name=f1 action="/Loginhandler+" method=post& gt");
successpage.append("& ltINPUT type=hidden name=\"Username\" value="+userID+"& gt");
successpage.append("& ltINPUT type=hidden name=\"Password\" value="+password+"& gt");
successpage.append("& ltINPUT type=hidden value=LoginModule name=module& gt");
successpage.append("& ltINPUT type=hidden value=verify name=action& gt");
successpage.append("& ltINPUT type=hidden name=RememberLogin value=" + rememberlogin + "& gt");
successpage.append("& lt/form& gt& lt/BODY& gt& lt/HTML& gt");
out.println(successpage.toString());
Can anyone tell what could be the problem with the scenario 1
Hope the question is clear
thanks in advance
Suresh