faces-config.xml 3.69 KB
<?xml version="1.0"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
              version="2.0">

    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>home</from-outcome>
            <to-view-id>/index.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/index.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>addBook</from-outcome>
            <to-view-id>/book.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>listBooks</from-outcome>
            <to-view-id>/result.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>addCountry</from-outcome>
            <to-view-id>/addCountry.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>listCountries</from-outcome>
            <to-view-id>/listCountries.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>addUser</from-outcome>
            <to-view-id>/updateUser.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>listUsers</from-outcome>
            <to-view-id>/listUsers.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/addPublisher.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/listPublisherRevisions.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/addCountry.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/listCountries.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/addUser_short.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/listUsers_short.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id>/book.xhtml</from-view-id>
    <navigation-case>
      <from-outcome>success</from-outcome>
      <to-view-id>/result.xhtml</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/result.xhtml</from-view-id>
    <navigation-case>
      <from-outcome>back</from-outcome>
      <to-view-id>/book.xhtml</to-view-id>
    </navigation-case>
  </navigation-rule>

    <navigation-rule>
        <from-view-id>/updateUser.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>cancel</from-outcome>
            <to-view-id>/listUsers.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/listUsers.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/listUsers.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>add</from-outcome>
            <to-view-id>/updateUser.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/listPublisherRevisions.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>view</from-outcome>
            <to-view-id>/publisherRevision.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
</faces-config>