title: JSP: Redirecting to xhtml in JSP
body: <p>i want to redirect to two different pages according if the user introduces a right password or not. I tried <code>sendRedirect</code> and <code>forward</code> but it didnt work. I have a <strong>Managed Bean</strong> that has the condition, and the xhtml pages that have to been shown according the condition.</p>
  
  <p><em><strong>Managed bean</em></strong></p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class datos {
  private String usuario, contraseña, response=null;
  
  public datos() {
  }
  
  public String getUsuario() {
      return usuario;
  }
  
  public void setUsuario(String usuario) {
      this.usuario = usuario;
  }
  
  public String getContraseña() {  
      return contraseña;
  }
  
  public void setContraseña(String contraseña) {    
      this.contraseña = contraseña;
  }
  
  public void getResponse() throws IOException{
      if(contraseña.equals("1111"))
                 **REDIRECT TO PAGE 1**    
      else {
                 **REDIRECT TO PAGE 2**
      }
  }
  
  }        
  </code></pre>
  
  <p>Thanks for your help!</p>