/** * Logs off the currently logged user. */ public void logout() { session.setAttribute(ATTR_LOGGEDIN, null); }
/** * Logs the user in if the login and password match. * * @param login * @param password * @return */ public boolean doLogin(final String login, final String password) { if (serverConfig.getAttribute("admin.login").equals(login) && serverConfig.getAttribute("admin.password").equals(password)) { session.setAttribute(ATTR_LOGGEDIN, "1"); return true; } else { LOGGER.fine("Not logging in - wrong password"); } return false; } }
request.getSession().setAttribute(attributeName, Integer.toString(pageHits));