Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="../loginController" method="post">
- <p> Username : <input type="text" id="name" name="username" required/</p>
- <p> password : <input type="text" name="password" required/> </p>
- <button type="submit"> Submit </button>
- </form>
- <h2><%=request.getAttribute("errorMessage") %></h2>
- if(loginRS.equals("user")){
- response.sendRedirect("User/User.jsp"); /*--This is working --*/
- } else if(loginRS.equals("admin")){
- response.sendRedirect("Admin/Admin.jsp"); /*--This is working --*/
- } else if(loginRS.equals("IncorrectPassword")) {
- /*--- This is where the problem starts ---*/
- RequestDispatcher rd =
- request.getRequestDispatcher("./Login/login.jsp");
- request.setAttribute("errorMessage", "Username Not found");
- rd.forward(request, response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement