[jboss-user] [JBoss jBPM] - Problem with navigation-rules
rodosa
do-not-reply at jboss.com
Fri Jan 25 06:48:23 EST 2008
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:
| <managed-bean>
| <managed-bean-name>usuario</managed-bean-name>
| <managed-bean-class>com.miApp.UserBean</managed-bean-class>
| <managed-bean-scope>request</managed-bean-scope>
| </managed-bean>
|
| <navigation-rule>
| <from-view-id>/SolicitarAlta.xhtml</from-view-id>
| <navigation-case>
| <from-action>#{usuario.registrar}</from-action>
| <from-outcome>correcto</from-outcome>
| <to-view-id>/results/correcto.jsp</to-view-id>
| </navigation-case>
| </navigation-rule>
|
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???
Thx!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123423#4123423
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123423
More information about the jboss-user
mailing list