hi, I want to direct to another page if a user is not present in the database.How do I go about doing this.The servlet gets the username and password from the html/jsp page. The servlet checks whether the use is present in the database,if the user and password is not present in the database,The user must be given an option for registration,a link to the register.jsp page. Hope that I have rightly phrased the question.Hoping to hear ASAP. Thanks in advance. as
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
1
posted
0
If I understand you correctly, what you want is the sendRedirect capability of the HttpServletResponse object. You should decide to redirect before writing any output to the response and should do a return from the servlet without trying to do anything else with the response. An alternative would be to use the RequestDispatcher forward method. Bill