Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. protected void processRequest(HttpServletRequest request, HttpServletResponse response)
  2. throws ServletException, IOException {
  3. response.setContentType("text/html;charset=UTF-8");
  4.  
  5. HttpSession sesion = request.getSession();
  6. PrintWriter out = response.getWriter();
  7.  
  8. String num = request.getParameter("num");
  9. String password = request.getParameter("password");
  10. sesion.setAttribute("num", num);
  11.  
  12. Queries sql = new Queries();
  13. if (sql.login(num, password)) {
  14. response.sendRedirect("private.jsp");
  15. } else {
  16. request.setAttribute("error", "Error on login");
  17. RequestDispatcher dispatcher =
  18. ServletContext().getRequestDispatcher("login.jsp"); // This line doesn't working
  19. dispatcher.forward(request, response);
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement