Package cc.concurrent.config.server.model

Examples of cc.concurrent.config.server.model.User


                }
            }
        }
        if (username != null && username.trim().length() > 0 // 用户名存在
                && DigestUtils.md5DigestAsHex(username.trim().getBytes()).equals(mark)) { // 用户名md5后和mark匹配
            User user = new User();
            user.setUsername(username);
            request.setAttribute("user", user);
            FlashRequestContext.getCurrentContext().setUsername(username);
            return true;
        }
        response.sendRedirect(request.getContextPath() + "/login");
View Full Code Here


    UserDao userDao;

    public boolean login(String username, String passward) {
        checkNotNull(username);
        checkNotNull(passward);
        User user = userDao.getUser(username);
        return user != null ? passward.equals(user.getPassword()) : false;
    }
View Full Code Here

    public User getUser(String username) {
        String sql = "select username, password from config_user where username=?";
        List<User> r = getJdbcTemplate().query(sql, new Object[]{username}, new RowMapper<User>() {
            @Override
            public User mapRow(ResultSet rs, int rowNum) throws SQLException {
                return new User(rs.getString(1), rs.getString(2));
            }
        });
        return !r.isEmpty() ? r.get(0) : null;
    }
View Full Code Here

TOP

Related Classes of cc.concurrent.config.server.model.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.