faces-config.xml 3.81 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/book.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>listBooks</from-outcome>
            <to-view-id>/book/result.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>addCountry</from-outcome>
            <to-view-id>/xyz/addCountry.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>listCountries</from-outcome>
            <to-view-id>/xyz/listCountries.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>addUser</from-outcome>
            <to-view-id>/user/updateUser.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>listUsers</from-outcome>
            <to-view-id>/user/listUsers.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/publisher/addPublisher.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/publisher/listPublisherRevisions.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
    <navigation-rule>
        <from-view-id>/xyz/addCountry.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/xyz/listCountries.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

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

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

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

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

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