How to configure multiple page.xml files in Seam 2.2


Seam lets you specify navigation rules in the pages.xml file which can become very large for apps with many pages and transitions. Seam allows you to break this file into multiple small files. This allows you to easily manage large applications by creating multiple pages.xml files, typically one per page. This article describes how to create multiple pages.xml files in Seam 2.2.

Step 1: Configure /WEB-INF/components.xml

Make sure you declare the navigation namespace at the top of components.xml and each file under <navigation:pages> as follows

<?xml version="1.0" encoding="UTF-8"?>
<components xmlns=""
 xmlns:core="" xmlns:persistence=""
 xmlns:drools="" xmlns:bpm=""
 xmlns:security="" xmlns:mail=""
 xmlns:web="" xmlns:navigation=""

 <mail:mail-session host="localhost" tls="false" ssl="false" port="25" />

  <property name="createTempFiles">true</property>
  <property name="maxRequestSize">1000000000</property>

 <component name="org.jboss.seam.core.init">
  <!-- enabling this slows down Seam significantly -->
  <property name="debug">false</property>

 <core:init transaction-management-enabled="false" />

 <security:identity authenticate-method="#{loginController.authenticate}"
  remember-me="true" />

 <event type="">
  <action execute="#{redirect.captureCurrentView}" />

 <event type="">
  <action execute="#{redirect.returnToCapturedView}" />

   <!-- global -->

   <!-- one per page -->

Step 2. Save all .page.xml files in WEB-INF directory


Step 3. Create the .page.xml files.

See the sample file: below. Note that the root tag is <pages>. Make sure that the same page is not repeated in another file.

<?xml version="1.0" encoding="UTF-8"?>
<pages xmlns="" xmlns:xsi=""

 <page view-id="/createAccount.xhtml" login-required="false">
 <!-- Create account -->

   <!-- Account created -->
   <rule if-outcome="accountCreated">
    <redirect view-id="/login.xhtml">
     <message>Your account has been created. Please log in.</message>


Can I use Seam 2.0 style <view id>.page.xml files?

You should be able to use xml files according to the examples that ship with Seam 2.2.0. However, some users have complained that it doesn’t work in Seam 2.1. I could not get it to work with Seam 2.2.0 as well.

Related posts:

  1. A common configuration mistake which makes Seam slow
  2. Seam Asynchronous Email
  3. Implementing context senstive permissions and authorization in JSF Seam
  4. Spring classpath scan breaks when migrating from JBoss4 to JBoss5
  5. Google introduces Page Speed

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wordpress themes