1 Reply Latest reply on Jan 25, 2008 10:41 AM by Ronald van Kuijk

    Problem with navigation-rules

    Sara Rodríguez Dorrego Novice

      I want to navigate to other page when I fill a form and I send the data that I entered. I have declare the navigation-rules but it doesn't work and I don't know why.

      In my faces-config.xml I've added the navigation-rules:


      The UserBean has the method registrar:

      public String registrar() {
       if(dni==null || nombre==null || apellidos==null || ocupacion==null || mail==null || tlf==null || password==null)
       return "campos-obligatorios";
       if ((mail.trim().length() < 3) || (mail.indexOf("@") == -1))
       return "mail-incorrecto";
       else if(tlf.length()!=9) return "telefono-incorrecto";
       else if(dni.length()!=8) {return "dni-incorrecto";}
       return "correcto";

      And with this line
      <h:commandButton type="submit" value="Enviar" action="#{usuario.registrar}"/>
      the method registrar is executed and I know that this method returns the string "correcto" but ... This doesn't redirect me to the page correcto.jsp

      I thought that maybe if SolicitarAlta was an xhtml file the correcto page should be also an .xhtml file. I changed it but it doesn't work.

      Any ideas? Could it be that I have to add something more in the faces-config.xml & web.xml file???