Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  2. // TODO Auto-generated method stub
  3. doGet(request, response);
  4.  
  5. RequestDispatcher requestDispatcher;
  6.  
  7. if (request.getParameterMap().containsKey("login") && request.getParameterMap().containsKey("password")) {
  8. String login = request.getParameter("login");
  9. String password = request.getParameter("password");
  10.  
  11. if (login.equals(password)) {
  12. HttpSession session = request.getSession(true);
  13. session.setAttribute("login", login);
  14. session.setMaxInactiveInterval(30);
  15. //response.sendRedirect("home.jsp");
  16. requestDispatcher = request.getRequestDispatcher("/Process");
  17. requestDispatcher.forward(request, response);
  18. }
  19. else {
  20. requestDispatcher = request.getRequestDispatcher("/LogIn");
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement