i am using a servlet to bring in a login page for my web application.but once i login and click on "submit" button,i should be redirected to another page. how do i do this? i am currently trying to use
RequestDispatcher rd = null;
rd = getServletContext().getRequestDispatcher("/NextServlet");
rd.forward(request, response);
Also tried using
response.sendRedirect("http://localhost:8080/myProject/NextServlet");
but nothing happens on click of submit, I do not want to include a link with href and use. What should I do?
NextServlet, at least make sure this servlet prints any HTML code or forward/redirects to a JSP.