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

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


    @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, null);
        if (ContextLoadListener.getUsers().contains(user)) {
            int index = ContextLoadListener.getUsers().indexOf(user);
            user = ContextLoadListener.getUsers().get(index);
            HttpSession session = req.getSession();
            session.setAttribute("login", user.getLogin());
            session.setAttribute("role", user.getRole());
            SessionDataStatistics.updateRoleSession(session);
            resp.sendRedirect("user");
        } else {
            req.setAttribute("wrong_login", true);
            req.getRequestDispatcher("index.jsp").forward(req, resp);
View Full Code Here


            for (int i = 0; i < nodeList.getLength(); i++) {
                Element userElement = (Element) nodeList.item(i);
                String login = userElement.getAttribute(NAME_ATTRIBUTE);
                String password = userElement.getAttribute(PASSWORD_ATTRIBUTE);
                String role = userElement.getAttribute(ROLE_ATTRIBUTE);
                userList.add(new User(login, password, role));
            }
        } catch (SAXException | IOException | ParserConfigurationException e) {
            e.printStackTrace();
            System.exit(0);
        }
View Full Code Here

TOP

Related Classes of com.luxoft.dnepr.courses.web.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.