Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void processRequest(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- PrintWriter out = response.getWriter();
- String user = request.getParameter("username");
- String pass = request.getParameter("password");
- JSONObject json = new JSONObject();
- try {
- LoginMDao loginDao = new LoginMDao();
- res = loginDao.checkData(user,pass);
- status = res.split("###")[0];
- message = res.split("###")[1];
- log.info("result "+ res);
- if(status.equals("success")) {
- HttpSession session = request.getSession();
- session.setAttribute("user",user);
- session.setMaxInactiveInterval(30*60); //30min inactive time
- response.sendRedirect("Profile.html");;
- }
- json.put("status", status);
- json.put("message", message);
- out.print(json.toString());
- } catch (Exception e) {
- log.error("Exception " ,e);
- }
- finally {
- out.close();
- }
- }
Add Comment
Please, Sign In to add comment