0

My beanLogIn class is requestedScoped. What I wanted to do is, if the user information was valid, oncomplete or immediately send the boolean validUser (pessoaValida) to beanHome. But this doesn't work. Why? Is the code wrong or is the session just closed before completion?

 <h:commandButton value="Log In" action="#{beanLogIn.verificarLogIn()}" immediate="#      
 {beanHome.verificarUsuario(beanLogIn.pessoaValida)}"
Hozei
  • 33
  • 3

1 Answers1

0

Try this, it should work.

 <h:commandButton value="Log In" action="#{beanLogIn.validateUser()}" />

@ManagedBean
@RequestScoped
public class BeanLogin {

    public String validateUser {
        // perform your validation logic
        return "beanHome?faces-redirect=true"; // here you should mention beanHome URL
    }

}
yuvi
  • 37
  • 5