2 Replies Latest reply on Apr 20, 2011 5:16 AM by Georges Goebel

    seam 3 and jsf navigation (pages.xml)

    Georges Goebel Newbie


      I have some applications using seam 2 and jsf frameworks (mainly icefaces)
      I took a look at seam3 and jsf2 and have some difficulties to get a proper navigation to work. In seam2/pages.xml I could have my actions which are referenced in the commandButton have a void return argument. I prefer having as less as possible navigation logic in my beans. So I do not want to return the view id in a save method.
      In seam2 that was fine because the whole navigation and security logic was in my pages.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <pages xmlns="http://jboss.com/products/seam/pages"
             xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"
          <page view-id="/login.xhtml">
                  <rule if="#{identity.loggedIn}">
                      <redirect view-id="/main.seam"/>
          <page view-id="/modifyVehicule.xhtml" login-required="true">
              <begin-conversation join="true"/>
              <navigation from-action="#{modifyVehicule.endActionSaveVehicule}">
                  <redirect view-id="/main.xhtml"/>
              <navigation from-action="#{modifyVehicule.endActionCancel}">
                  <redirect view-id="/main.xhtml"/>

      I tried a simple example in seam3 with the navigation rules in the faces-config.xml, but it does not work as expected.
      For example :

      The following rule works only if the return type of the create method is a String. The value of the return value is not important.


      Is it possible to achieve the same behavior of the old seam2/pages.xml with seam3 ?

      I checked out the faces module and saw something with the @ViewConfig but I do not know if this would solve my problem.

      Thanks for all suggestions


      Georges Goebel