I have a simple form which accepts a username and a password. I have to use sendRedirect() method for the page to redirect to one page if log in is valid and to
sendRedirect()
Check out this once :
String url = "http://www.mysite/servlets/theServlet"; RequestDispatcher dispatcher = servletContext().getRequestDispatcher(url); dispatcher.forward(request, response);