Package com.luxoft.dnepr.courses.web.login.domain

Examples of com.luxoft.dnepr.courses.web.login.domain.User


            NodeList nodeList = doc.getElementsByTagName(USER_TAG);
            for (int i = 0; i < nodeList.getLength(); i++) {
                Element eElement = (Element) nodeList.item(i);
                String login = eElement.getAttribute(NAME_ATTRIBUTE);
                String password = eElement.getAttribute(PASSWORD_ATTRIBUTE);
                userList.add(new User(login, password));
            }
        } catch (SAXException | IOException | ParserConfigurationException e) {
            e.printStackTrace();
        }
    }
View Full Code Here


    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String login = req.getParameter("login");
        String password = req.getParameter("password");
        User user = new User(login, password);
        if (ContextLoadListener.getUsers().contains(user)) {
            HttpSession session = req.getSession();
            session.setAttribute("login", user.getLogin());
            System.out.println(DispatcherServlet.USER_PAGE);
            resp.sendRedirect(DispatcherServlet.USER_PAGE);
        } else {
            req.setAttribute("wrong_login", true);
            req.getRequestDispatcher(DispatcherServlet.HOME_PAGE_JSP).forward(req, resp);
View Full Code Here

TOP

Related Classes of com.luxoft.dnepr.courses.web.login.domain.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.