I have a login form and a servlet that makes the login. If the user is valid, i redirect him to the next page
response.sendRedirect("welcome.jsp");
Also i want to send an object to this page, so i replace the sendRedirect with this
request.setAttribute("notes", notesObject)
disp = getServletContext().getRequestDispatcher("/welcome.jsp");
disp.forward(request, response);
The problem now is that now, when a user logs in (e.g. user / 111), in the address bar i have this:
localhost:8084/WebApplication2/loginServlet?username=user&password=111&action=LOGIN
but when i used the Sendredirect i had only the localhost:8084/WebApplication2/welcome.jsp
The login Servlet:
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//code...
The jsp file:
<form action="loginServlet">
//code...