Beispiel #1
0
 public String login() throws AmadorProException {
   LoginTO to = new LoginTO();
   try {
     BeanUtils.copyProperties(to, this);
   } catch (IllegalAccessException e) {
     throw new AmadorProException(e);
   } catch (InvocationTargetException e) {
     throw new AmadorProException(e);
   }
   boolean isLogged = LoginHelper.login(to);
   if (!isLogged) {
     addMessagePagePanel("Username e/ou Senha Invalidos");
   } else {
     try {
       // troca o identificador de sessao
       // Logger log = ESAPI.getLogger(this.getClass());
       ESAPI.httpUtilities().changeSessionIdentifier(FacesUtil.getRequest());
       System.out.println("depois " + FacesUtil.getRequest().getSession(false).getId());
     } catch (AuthenticationException e) {
       throw new AmadorProException(e);
     }
   }
   return isLogged ? Constants.SUCCESS : Constants.ERROR;
 }