You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by bu...@apache.org on 2014/01/18 19:21:06 UTC

svn commit: r894647 [6/9] - in /websites/production/tapestry/content: ./ cache/

Modified: websites/production/tapestry/content/integrating-with-jpa.html
==============================================================================
--- websites/production/tapestry/content/integrating-with-jpa.html (original)
+++ websites/production/tapestry/content/integrating-with-jpa.html Sat Jan 18 18:21:05 2014
@@ -29,6 +29,7 @@
   <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
   <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
   <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
   <script type="text/javascript">
   SyntaxHighlighter.defaults['toolbar'] = false;
   SyntaxHighlighter.all();
@@ -81,29 +82,18 @@
     </div>
 
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
-</div>
-
-<p>Starting with Tapestry 5.3, Tapestry provides built-in integration with the Java Persistence API (JPA). This module supersedes <a shape="rect" class="external-link" href="http://tynamo.org/tapestry-jpa+guide" >Tynamo's JPA integration</a>.</p>
+<p>&#160;</p></div><p>Starting with Tapestry 5.3, Tapestry provides built-in integration with the Java Persistence API (JPA). This module supersedes <a shape="rect" class="external-link" href="http://tynamo.org/tapestry-jpa+guide" >Tynamo's JPA integration</a>.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/
+div.rbtoc1390069257494 {padding: 0px;}
+div.rbtoc1390069257494 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1390069257494 li {margin-left: 0px;padding-left: 0px;}
 
-<p><strong>Contents</strong></p>
-<style type="text/css">/*<![CDATA[*/
-div.rbtoc1387423370076 {padding: 0px;}
-div.rbtoc1387423370076 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1387423370076 li {margin-left: 0px;padding-left: 0px;}
-
-/*]]>*/</style><div class="toc-macro rbtoc1387423370076">
+/*]]>*/</style></p><div class="toc-macro rbtoc1390069257494">
 <ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithJPA-ConfiguringJPA">Configuring JPA</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithJPA-XML-lessJPAconfiguration">XML-less JPA configuration</a></li><li><a shape="rect" href="#IntegratingwithJPA-Automaticallyaddingmanagedclasses">Automatically adding managed classes</a></li></ul>
 </li><li><a shape="rect" href="#IntegratingwithJPA-InjectingtheEntityManager">Injecting the EntityManager</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithJPA-InjectingtheEntityManagerintopageandcomponentclasses">Injecting the EntityManager into page and component classes</a></li><li><a shape="rect" href="#IntegratingwithJPA-InjectingEntityManagerintoservices">Injecting EntityManager into services</a></li></ul>
 </li><li><a shape="rect" href="#IntegratingwithJPA-Transactionmanagement">Transaction management</a></li></ul>
-</div>
-
-<h1 id="IntegratingwithJPA-ConfiguringJPA">Configuring JPA</h1>
-
-<p>The persistence.xml file is the standard configuration file in JPA used to define the persistence units. Tapestry reads this file to create the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a>. The following example demonstrates a persistence.xml file.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div><h1 id="IntegratingwithJPA-ConfiguringJPA">Configuring JPA</h1><p>The persistence.xml file is the standard configuration file in JPA used to define the persistence units. Tapestry reads this file to create the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a>. The following example demonstrates a persistence.xml file.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot; version=&quot;2.0&quot;&gt;
    &lt;persistence-unit name=&quot;DemoUnit&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
@@ -117,11 +107,7 @@ div.rbtoc1387423370076 li {margin-left: 
    &lt;/persistence-unit&gt;
 
 &lt;/persistence&gt;]]></script>
-</div></div>
-
-<p>By default, the persistence descriptor is named <em>persistence.xml</em> and is expected to be located on the classpath in the <em>META-INF</em> directory. If you want to place the <em>persistence.xml</em> file in another directory or name it differently, you can make a contribution to the <em>SymbolProvider</em> service, as shown in the following example. This is a quite useful feature if you want to use a different persistence descriptor for tests.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>By default, the persistence descriptor is named <em>persistence.xml</em> and is expected to be located on the classpath in the <em>META-INF</em> directory. If you want to place the <em>persistence.xml</em> file in another directory or name it differently, you can make a contribution to the <em>SymbolProvider</em> service, as shown in the following example. This is a quite useful feature if you want to use a different persistence descriptor for tests.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
     @Contribute(SymbolProvider.class)
@@ -131,13 +117,7 @@ div.rbtoc1387423370076 li {margin-left: 
     }
 
 }]]></script>
-</div></div>
-
-<h2 id="IntegratingwithJPA-XML-lessJPAconfiguration">XML-less JPA configuration</h2>
-
-<p>With Tapestry, configuring JPA is much simpler than as described in the JPA specification. Tapestry allows you to configure the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> programmatically, without writing any XML. Imagine you want to use JDBC connections managed by the container and provided through JNDI. The resulting persistence descriptor might look like this:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h2 id="IntegratingwithJPA-XML-lessJPAconfiguration">XML-less JPA configuration</h2><p>With Tapestry, configuring JPA is much simpler than as described in the JPA specification. Tapestry allows you to configure the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> programmatically, without writing any XML. Imagine you want to use JDBC connections managed by the container and provided through JNDI. The resulting persistence descriptor might look like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot;
              version=&quot;2.0&quot;&gt;
@@ -154,11 +134,7 @@ div.rbtoc1387423370076 li {margin-left: 
    &lt;/persistence-unit&gt;
 
 &lt;/persistence&gt;]]></script>
-</div></div>
-
-<p>Now let's see how to provide the same configuration <em>without</em> XML. The following demonstrates an equivalent JPA configuration.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Now let's see how to provide the same configuration <em>without</em> XML. The following demonstrates an equivalent JPA configuration.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
    @Contribute(EntityManagerSource.class)
@@ -177,27 +153,13 @@ div.rbtoc1387423370076 li {margin-left: 
      cfg.add(&quot;JTAUnit&quot;, configurer);
    }
 }]]></script>
-</div></div>
-
-<p>In the example above you can see a contribution to the <em>EntityManagerSource</em> service. This service is responsible for creating the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> to be used to create <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a>. When the service is initialized, it parses the <em>persistence.xml</em> file, if available. For any persistence unit defined in the XML descriptor a <em>TapestryPersistenceUnitInfo</em> object is created. The <em>TapestryPersistenceUnitInfo</em> interface is a mutable extension of the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/spi/PersistenceUnitInfo.html" >PersistenceUnitInfo</a> interface (defined in the JPA specification) that allows you to configure a persistence unit pr
 ogrammatically.</p>
-
-<p>After parsing the persistence descriptor, the EntityManagerSource service applies its configuration to create further persistence units and/or update the existing ones. The service&#8217;s configuration is a map in which persistence unit names are associated with <em>PersistenceUnitConfigurer</em> instances. A PersistenceUnitConfigurer is used to configure a persistence unit programmatically that has been associated with it. In the example above you can see a contribution providing a PersistenceUnitConfigurer for the unit named <em>JTAUnit</em>.</p>
-
-    <div class="aui-message hint shadowed information-macro">
+</div></div><p>In the example above you can see a contribution to the <em>EntityManagerSource</em> service. This service is responsible for creating the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> to be used to create <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a>. When the service is initialized, it parses the <em>persistence.xml</em> file, if available. For any persistence unit defined in the XML descriptor a <em>TapestryPersistenceUnitInfo</em> object is created. The <em>TapestryPersistenceUnitInfo</em> interface is a mutable extension of the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/spi/PersistenceUnitInfo.html" >PersistenceUnitInfo</a> interface (defined in the JPA specification) that allows you to configure a persist
 ence unit programmatically.</p><p>After parsing the persistence descriptor, the EntityManagerSource service applies its configuration to create further persistence units and/or update the existing ones. The service&#8217;s configuration is a map in which persistence unit names are associated with <em>PersistenceUnitConfigurer</em> instances. A PersistenceUnitConfigurer is used to configure a persistence unit programmatically that has been associated with it. In the example above you can see a contribution providing a PersistenceUnitConfigurer for the unit named <em>JTAUnit</em>.</p>    <div class="aui-message hint shadowed information-macro">
                             <span class="aui-icon icon-hint">Icon</span>
                 <div class="message-content">
                             <p>Note that the TapestryPersistenceUnitInfo instance passed to the PersistenceUnitConfigurer is either empty or my contain the persistence unit metadata read from the persistence.xml file. What happens if you contribute a PersistenceUnitConfigurer for a persistence unit that has not been defined in the persistence.xml file? In this case Tapestry assumes that you want to configure the persistence unit programmatically and just creates a fresh <em>TapestryPersistenceUnitInfo</em> object and passes it to the <em>PersistenceUnitConfigurer</em>.</p>
                     </div>
     </div>
-
-
-<h2 id="IntegratingwithJPA-Automaticallyaddingmanagedclasses">Automatically adding managed classes </h2>
-
-<p>If only a single persistence unit is defined, Tapestry scans the  <em>application-root-package.entities</em> package. The classes in that package are automatically added as managed classes to the defined persistence unit.</p>
-
-<p>If you have additional packages containing entities, you may contribute them to the <em>JpaEntityPackageManager</em> service configuration.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<h2 id="IntegratingwithJPA-Automaticallyaddingmanagedclasses">Automatically adding managed classes</h2><p>If only a single persistence unit is defined, Tapestry scans the <em>application-root-package.entities</em> package. The classes in that package are automatically added as managed classes to the defined persistence unit.</p><p>If you have additional packages containing entities, you may contribute them to the <em>JpaEntityPackageManager</em> service configuration.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
    @Contribute(JpaEntityPackageManager.class)
@@ -207,18 +169,7 @@ div.rbtoc1387423370076 li {margin-left: 
       configuration.add(&quot;com.acme.model&quot;);
    }
 }]]></script>
-</div></div>
-<p>As you can see, you may add as many packages as you wish.</p>
-
-<h1 id="IntegratingwithJPA-InjectingtheEntityManager">Injecting the EntityManager</h1>
-
-<p>The created entity managers can be injected into page, component and other services.  </p>
-
-<h2 id="IntegratingwithJPA-InjectingtheEntityManagerintopageandcomponentclasses">Injecting the EntityManager into page and component classes</h2>
-
-<p>Depending on whether more than one persistence unit has been defined, the way to inject <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a> varies slightly. Let&#8217;s start with a simple scenario, where only a single persistence unit is defined. In this case, an EntityManager can be injected using the @Inject annotation.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>As you can see, you may add as many packages as you wish.</p><h1 id="IntegratingwithJPA-InjectingtheEntityManager">Injecting the EntityManager</h1><p>The created entity managers can be injected into page, component and other services.</p><h2 id="IntegratingwithJPA-InjectingtheEntityManagerintopageandcomponentclasses">Injecting the EntityManager into page and component classes</h2><p>Depending on whether more than one persistence unit has been defined, the way to inject <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a> varies slightly. Let&#8217;s start with a simple scenario, where only a single persistence unit is defined. In this case, an EntityManager can be injected using the @Inject annotation.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
 
    @Inject
@@ -232,11 +183,7 @@ div.rbtoc1387423370076 li {margin-left: 
       entityManager.persist(address);
    }
 }]]></script>
-</div></div>
-
-<p>Alternatively, you can use the @<a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html" >PersistenceContext</a> annotation to get the EntityManager injected into a page or component, as shown in the following example.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Alternatively, you can use the @<a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html" >PersistenceContext</a> annotation to get the EntityManager injected into a page or component, as shown in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
 
    @PersistenceContext
@@ -250,11 +197,7 @@ div.rbtoc1387423370076 li {margin-left: 
       entityManager.persist(address);
    }
 }]]></script>
-</div></div>
-
-<p>If you have multiple instances of persistence-unit defined in the same application, you need to explicitly tell Tapestry which persistence unit you want to get injected. This is what the @PersistenceContext annotation&#8217;s <em>name</em> attribute is used for?  The following example demonstrates how to inject the persistence unit named <em>DemoUnit</em>. </p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>If you have multiple instances of persistence-unit defined in the same application, you need to explicitly tell Tapestry which persistence unit you want to get injected. This is what the @PersistenceContext annotation&#8217;s <em>name</em> attribute is used for? The following example demonstrates how to inject the persistence unit named <em>DemoUnit</em>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
 
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
@@ -269,24 +212,14 @@ div.rbtoc1387423370076 li {margin-left: 
       entityManager.persist(address);
    }
 }]]></script>
-</div></div>
-
-<h2 id="IntegratingwithJPA-InjectingEntityManagerintoservices">Injecting EntityManager into services</h2>
-
-<p>While component injection occurs only on fields, the injection in the IoC layer may be triggered by a  field or a constructor. The following example demonstrates field injection, when a single persistence unit is defined in the persistence descriptor.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h2 id="IntegratingwithJPA-InjectingEntityManagerintoservices">Injecting EntityManager into services</h2><p>While component injection occurs only on fields, the injection in the IoC layer may be triggered by a field or a constructor. The following example demonstrates field injection, when a single persistence unit is defined in the persistence descriptor.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
    @Inject
    private EntityManager entityManager;
 
    ...
 }]]></script>
-</div></div>
-
-<p>The constructor injection is demonstrated in the following example.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The constructor injection is demonstrated in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
 
    private EntityManager entityManager;
@@ -297,11 +230,7 @@ div.rbtoc1387423370076 li {margin-left: 
 
    ...
 }]]></script>
-</div></div>
-
-<p>If multiple persistence units are defined in the same application, you need to disambiguate the unit to inject. This is done with the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html" >@PersistenceContext</a> annotation, as shown in the following example. Because @PersistenceContext must not be placed on constructor parameters, you can&#8217;t use constructor injection and must switch to field injection.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>If multiple persistence units are defined in the same application, you need to disambiguate the unit to inject. This is done with the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html" >@PersistenceContext</a> annotation, as shown in the following example. Because @PersistenceContext must not be placed on constructor parameters, you can&#8217;t use constructor injection and must switch to field injection.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
    @Inject
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
@@ -309,13 +238,7 @@ div.rbtoc1387423370076 li {margin-left: 
 
    ...
 }]]></script>
-</div></div>
-
-<h1 id="IntegratingwithJPA-Transactionmanagement">Transaction management</h1>
-
-<p>As you may already know from the Hibernate integration library, Tapestry automatically manages transactions for you. The JPA integration library defines the @CommitAfter annotation, which acts as the correspondent annotation from the Hibernate integration library. Let&#8217;s explore the <em>UserDAO</em> interface to see the annotation in action.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h1 id="IntegratingwithJPA-Transactionmanagement">Transaction management</h1><p>As you may already know from the Hibernate integration library, Tapestry automatically manages transactions for you. The JPA integration library defines the @CommitAfter annotation, which acts as the correspondent annotation from the Hibernate integration library. Let&#8217;s explore the <em>UserDAO</em> interface to see the annotation in action.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public interface UserDAO {
 
    @CommitAfter
@@ -328,21 +251,13 @@ div.rbtoc1387423370076 li {margin-left: 
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
    void delete(User... users);
 }]]></script>
-</div></div>
-
-<p>As you can see, the annotation may be placed on service method in order to mark that method as transactional. Any method marked with the @CommitAfter annotation will have a transaction started before, and committed after, it is called. Runtime exceptions thrown by by a transactional method will abort the transaction. Checked exceptions are ignored and the transaction will be committed anyway.</p>
-
-    <div class="aui-message problem shadowed information-macro">
+</div></div><p>As you can see, the annotation may be placed on service method in order to mark that method as transactional. Any method marked with the @CommitAfter annotation will have a transaction started before, and committed after, it is called. Runtime exceptions thrown by by a transactional method will abort the transaction. Checked exceptions are ignored and the transaction will be committed anyway.</p>    <div class="aui-message problem shadowed information-macro">
                             <span class="aui-icon icon-problem">Icon</span>
                 <div class="message-content">
                             <p>Note that <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityTransaction.html" >EntityTransaction</a> interface does not support two phase commits. Committing transactions of multiple EntityManagers in the same request might result in data consistency issues. That&#8217;s why @CommitAfter annotation must be accompanied by the @PersistenceContext annotation if multiple persistence unit are defined in an application. This way you can only commit the transaction of a single persistence unit. You should be very carefully, if you are committing multiple transactions manually in the same request.</p>
                     </div>
     </div>
-
-
-<p>After placing the @CommitAfter annotation on methods, you need to tell Tapestry to advise those methods. This is accomplished by adding the transaction advice, as shown in the following example.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<p>After placing the @CommitAfter annotation on methods, you need to tell Tapestry to advise those methods. This is accomplished by adding the transaction advice, as shown in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
    @Match(&quot;*DAO&quot;)

Modified: websites/production/tapestry/content/integrating-with-spring-framework.html
==============================================================================
--- websites/production/tapestry/content/integrating-with-spring-framework.html (original)
+++ websites/production/tapestry/content/integrating-with-spring-framework.html Sat Jan 18 18:21:05 2014
@@ -29,6 +29,7 @@
   <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
   <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
   <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
   <script type="text/javascript">
   SyntaxHighlighter.defaults['toolbar'] = false;
   SyntaxHighlighter.all();
@@ -76,7 +77,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="integrating-with-spring-framework.html">Integrating with Spring Framework</a>
+                            <a shape="rect" href="security.html">Security</a>
                     
                 
                             </div>
@@ -85,106 +86,48 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="security.html">Security</a>
+                            <a shape="rect" href="integrating-with-spring-framework.html">Integrating with Spring Framework</a>
                     
                 
                             </div>
         </li></ul>
-</div> 
+</div><p>Tapestry easily integrates with Spring Framework, allowing beans defined by Spring to be injected into Tapestry IoC services, and into Tapestry components. In addition, with Tapestry 5.2 and later, you can also go the other way, injecting Tapestry services in Spring beans.</p><p>For integrating Spring Security into your application, see <a shape="rect" href="security.html">Security</a>.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/
+div.rbtoc1390069257106 {padding: 0px;}
+div.rbtoc1390069257106 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1390069257106 li {margin-left: 0px;padding-left: 0px;}
 
-<p>Tapestry easily integrates with Spring Framework, allowing beans defined by Spring to be injected into Tapestry IoC services, and into Tapestry components.  In addition, with Tapestry 5.2 and later, you can also go the other way, injecting Tapestry services in Spring beans.</p>
-
-<p>For integrating Spring Security into your application, see <a shape="rect" href="security.html">Security</a>.</p>
-
-<p><strong>Contents</strong></p>
-<style type="text/css">/*<![CDATA[*/
-div.rbtoc1387423343047 {padding: 0px;}
-div.rbtoc1387423343047 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1387423343047 li {margin-left: 0px;padding-left: 0px;}
-
-/*]]>*/</style><div class="toc-macro rbtoc1387423343047">
+/*]]>*/</style></p><div class="toc-macro rbtoc1390069257106">
 <ul class="toc-indentation"><li>Related Articles</li></ul>
 <ul><li><a shape="rect" href="#IntegratingwithSpringFramework-SpringVersion">Spring Version</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Usage">Usage</a>
-<ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithSpringFramework-Requireddependency">Required dependency</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Updateyourweb.xmlfile">Update your web.xml file</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-AccessingtheSpringApplicationContext">Accessing the Spring Application Context</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Injectingbeans">Injecting beans</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-InjectingTapestryservicesinSpringbeans">Injecting Tapestry services in Spring beans</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-ConfiguringSpringwithTapestrySymbols">Configuring Spring with Tapestry Symbols</a></li></ul>
+<ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithSpringFramework-Requireddependency">Required dependency</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Updateyourweb.xmlfile">Update your web.xml file</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-AccessingtheSpringApplicationContext">Accessing the Spring Application Context</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Injectingbeans">Injecting beans</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-InjectingTapestryservicesinSpringbeans">Injecting Tapestry services in Spring beans</a></li></ul>
 </li><li><a shape="rect" href="#IntegratingwithSpringFramework-ApplicationContextCustomizer">ApplicationContextCustomizer</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-5.0CompatibilityMode">5.0 Compatibility Mode</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-ChangesFrom5.0">Changes From 5.0</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Limitations">Limitations</a></li></ul>
-</div>
-
-<h2 id="IntegratingwithSpringFramework-SpringVersion">Spring Version</h2>
-
-<p>This module is compiled and tested against Spring Framework 2.5.6. It should be reasonable to override the dependency to earlier versions of Spring, though the code makes use of some APIs that were added to Spring to support JDK 1.5 annotations.</p>
-
-<h2 id="IntegratingwithSpringFramework-Usage">Usage</h2>
-
-<p>The integration is designed to be a very thin layer on top of Spring's normal configuration for a web application.</p>
-
-<p>Detailed instructions are available in the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#context-create" >Spring documentation</a>. Please omit the part about creating a ContextLoaderListener: this is now done automatically by Tapestry.</p>
-
-<h3 id="IntegratingwithSpringFramework-Requireddependency">Required dependency</h3>
-
-<p>To integrate Spring with Tapestry, you should add the below dependency in your classpath. The following exemple is for Maven users.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-  &lt;dependency&gt;
+</div><h2 id="IntegratingwithSpringFramework-SpringVersion">Spring Version</h2><p>This module is compiled and tested against Spring Framework 2.5.6. It should be reasonable to override the dependency to earlier versions of Spring, though the code makes use of some APIs that were added to Spring to support JDK 1.5 annotations.</p><h2 id="IntegratingwithSpringFramework-Usage">Usage</h2><p>The integration is designed to be a very thin layer on top of Spring's normal configuration for a web application.</p><p>Detailed instructions are available in the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#context-create" >Spring documentation</a>. Please omit the part about creating a ContextLoaderListener: this is now done automatically by Tapestry.</p><h3 id="IntegratingwithSpringFramework-Requireddependency">Required dependency</h3><p>To integrate Spring with Tapestry, you should add the below dependency in your classpath.
  The following exemple is for Maven users.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;dependency&gt;
     &lt;groupId&gt;org.apache.tapestry&lt;/groupId&gt;
     &lt;artifactId&gt;tapestry-spring&lt;/artifactId&gt;
     &lt;version&gt;[your-tapestry-version]&lt;/version&gt;
   &lt;/dependency&gt;
 ]]></script>
-</div></div>
-
-<h3 id="IntegratingwithSpringFramework-Updateyourweb.xmlfile">Update your web.xml file</h3>
-
-<p>The short form is that you must make two small changes to your application's web.xml.</p>
-
-<p>First, a special filter is used in replace of the standard TapestryFilter:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  &lt;filter&gt;
+</div></div><h3 id="IntegratingwithSpringFramework-Updateyourweb.xmlfile">Update your web.xml file</h3><p>The short form is that you must make two small changes to your application's web.xml.</p><p>First, a special filter is used in replace of the standard TapestryFilter:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;filter&gt;
     &lt;filter-name&gt;app&lt;/filter-name&gt;
     &lt;!-- Special filter that adds in a T5 IoC module derived from the Spring WebApplicationContext. --&gt;
     &lt;filter-class&gt;org.apache.tapestry5.spring.TapestrySpringFilter&lt;/filter-class&gt;
   &lt;/filter&gt;]]></script>
-</div></div>
-
-<p>Secondly, you may add the normal Spring configuration, consisting of an optional &lt;context-param&gt; identifying which Spring bean configuration file(s) to load:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;context-param&gt;
+</div></div><p>Secondly, you may add the normal Spring configuration, consisting of an optional &lt;context-param&gt; identifying which Spring bean configuration file(s) to load:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;context-param&gt;
   &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
   &lt;param-value&gt;/WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml&lt;/param-value&gt;
 &lt;/context-param&gt;
 ]]></script>
-</div></div>
-
-<p>The &lt;context-param&gt; lists the Spring bean configuration file. It is optional and defaults to just /WEB-INF/applicationContext.xml if omitted.</p>
-
-<h3 id="IntegratingwithSpringFramework-AccessingtheSpringApplicationContext">Accessing the Spring Application Context</h3>
-
-<p>By integrating Spring in Tapestry, you get full access on Spring ApplicationContext as if you were accessing to any Tapestry service. Simply @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> into your pages and components.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  @Inject
+</div></div><p>The &lt;context-param&gt; lists the Spring bean configuration file. It is optional and defaults to just /WEB-INF/applicationContext.xml if omitted.</p><h3 id="IntegratingwithSpringFramework-AccessingtheSpringApplicationContext">Accessing the Spring Application Context</h3><p>By integrating Spring in Tapestry, you get full access on Spring ApplicationContext as if you were accessing to any Tapestry service. Simply @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> into your pages and components.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  @Inject
   private ApplicationContext springContext;
 ]]></script>
-</div></div>
-
-<h3 id="IntegratingwithSpringFramework-Injectingbeans">Injecting beans</h3>
-
-<p>Inside your component classes, you may use the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> annotation. Typically, just adding @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> to the field type is sufficient to identify the Spring bean to inject:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  @Inject
+</div></div><h3 id="IntegratingwithSpringFramework-Injectingbeans">Injecting beans</h3><p>Inside your component classes, you may use the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> annotation. Typically, just adding @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> to the field type is sufficient to identify the Spring bean to inject:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  @Inject
   private UserDAO userDAO;]]></script>
-</div></div>
-
-<p>Searching for Spring beans is threaded into the <a shape="rect" href="injection.html">MasterObjectProvider service</a>. The Spring context becomes one more place that Tapestry searches when determining the injection for a injected field or method parameter.</p>
-
-
+</div></div><p>Searching for Spring beans is threaded into the <a shape="rect" href="injection.html">MasterObjectProvider service</a>. The Spring context becomes one more place that Tapestry searches when determining the injection for a injected field or method parameter.</p><h3 id="IntegratingwithSpringFramework-InjectingTapestryservicesinSpringbeans">Injecting Tapestry services in Spring beans</h3>
 
     <div class="aui-message hint shadowed information-macro">
                     <p class="title">Added in 5.2</p>
@@ -196,73 +139,32 @@ div.rbtoc1387423343047 li {margin-left: 
     </div>
 
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
-
-<h3><a shape="rect" name="IntegratingwithSpringFramework-InjectingTapestryservicesinSpringbeans"></a>Injecting Tapestry services in Spring beans</h3>
-
 <p>If you have configured Spring to allow annotation-based injection, then you will be able to inject Tapestry services into your Spring Beans.</p>
 
 <p>This feature is only available when Spring ApplicationContext is not configured and loaded externally.</p>
 
 <p>Inside your Spring beans, you may use @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> and @<a shape="rect" class="external-link" href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/annotation/Autowired.html" >Autowired</a> annotations.</p>
 
-<p>Simply add these two annotations on top the field you want to inject in your Spring bean.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  @Inject
-  @Autowired
-  private MyService myService;
-]]></script>
-</div></div>
-
-<p>or use @Inject on top of arguments in @Autowired bean constructor methods</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  private final MyService myService;
-
-  @Autowired
-  public UserDAOImpl(@Inject MyService myService)
-  {
-    this.myService = myService;
-  }
-]]></script>
-</div></div>
-
-<h3><a shape="rect" name="IntegratingwithSpringFramework-ConfiguringSpringwithTapestrySymbols"></a>Configuring Spring with Tapestry Symbols</h3>
-
-<p>This is accomplished by a BeanFactoryPostProcessors that resolves the values of 'placeholders' from symbol values. In the following example the value of the Bean's property 'productionMode' is the value of the Tapestry's  symbol <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SymbolConstants.html#PRODUCTION_MODE">tapestry.production-mode</a></p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-  &lt;bean id=&quot;myBean&quot; class=&quot;org.example.MyBean&quot;&gt;
-    &lt;property name=&quot;productionMode&quot; value=&quot;${tapestry.production-mode}&quot;/&gt;
+</div><pre>Simply add these two annotations on top the field you want to inject in your Spring bean.
+</pre><pre>{code:language=java}</pre><pre>    @Inject
+    @Autowired
+    private MyService myService;</pre><pre>{code}
+
+or use @Inject on top of arguments in @Autowired bean constructor methods</pre><pre>{code:language=java}</pre><pre>    private final MyService myService;
+    @Autowired
+    public UserDAOImpl(@Inject MyService myService)
+    {
+      this.myService = myService;
+    }
+{code}</pre><pre>h3. Configuring Spring with Tapestry Symbols
+
+This is accomplished by a BeanFactoryPostProcessors that resolves the values of 'placeholders' from symbol values. In the following example the value of the Bean's property 'productionMode' is the value of the Tapestry's  symbol [tapestry.production-mode|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SymbolConstants.html#PRODUCTION_MODE]
+
+{code:language=xml}
+  &lt;bean id="myBean" class="org.example.MyBean"&gt;
+    &lt;property name="productionMode" value="${tapestry.production-mode}"/&gt;
   &lt;/bean&gt;
-]]></script>
-</div></div>
-
-</div>
-
-<h2 id="IntegratingwithSpringFramework-ApplicationContextCustomizer">ApplicationContextCustomizer</h2>
-
-<p>A chain-of-command service, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/spring/ApplicationContextCustomizer.html">ApplicationContextCustomizer</a> allows the application context, created by Tapestry, to be customized as it is created. You may contribute your own ApplicationContextCustomizer instances as needed.</p>
-
-<h2 id="IntegratingwithSpringFramework-5.0CompatibilityMode">5.0 Compatibility Mode</h2>
-
-<p>In some circumstances, it is desirable to configure the Spring ApplicationContext externally. The context &lt;config-param&gt; "tapestry.use-external-spring-context" can be configured to "true". Tapestry will then use an existing ApplicationContext, provided by a Spring ContextLoaderListener. You will still be able to inject Spring beans into Tapestry components and services, and the ApplicationContext service will be visible ... but you will not be able to inject Tapestry IoC services into Spring beans.</p>
-
-<p>This option provides compatibility with the tapestry-spring 5.0, including exposing Spring beans as Tapestry IoC services (something that no longer occurs unless compatibility mode is enabled).</p>
-
-<h2 id="IntegratingwithSpringFramework-ChangesFrom5.0">Changes From 5.0</h2>
-
-<p>The changes below represent an unfortunate backwards compatibility issue. If necessary, you can still use tapestry-spring version 5.0.18 with the rest of Tapestry.</p>
-
-<ul class="alternate"><li>You may now use the @Inject or @InjectService annotations inside Spring beans; these will be resolved to Tapestry services or other objects available via the MasterObjectProvider. Please see the <a shape="rect" href="injection-in-detail.html">detailed guide to Injection</a>.</li><li>The dependency on Spring is no longer scope "provider" and has changed to 2.5.6.</li><li>Spring Beans are no longer exposed as services, unless 5.0 compatibility mode is enabled.</li><li>You no longer create a ContextLoaderListener.</li></ul>
-
-
-<h2 id="IntegratingwithSpringFramework-Limitations">Limitations</h2>
-
-<p>Non-singleton beans are not handled properly. Tapestry will request the beans from the application context in a manner unsuitable for their life cycle. For the moment, you should consider the non-singleton beans to be not injectable. Instead, inject the ApplicationContext service and obtain the non-singleton beans as needed.</p></div>
+{code}</pre><h2 id="IntegratingwithSpringFramework-ApplicationContextCustomizer">ApplicationContextCustomizer</h2><p>A chain-of-command service, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/spring/ApplicationContextCustomizer.html">ApplicationContextCustomizer</a> allows the application context, created by Tapestry, to be customized as it is created. You may contribute your own ApplicationContextCustomizer instances as needed.</p><h2 id="IntegratingwithSpringFramework-5.0CompatibilityMode">5.0 Compatibility Mode</h2><p>In some circumstances, it is desirable to configure the Spring ApplicationContext externally. The context &lt;config-param&gt; "tapestry.use-external-spring-context" can be configured to "true". Tapestry will then use an existing ApplicationContext, provided by a Spring ContextLoaderListener. You will still be able to inject Spring beans into Tapestry components and services, and the ApplicationContext ser
 vice will be visible ... but you will not be able to inject Tapestry IoC services into Spring beans.</p><p>This option provides compatibility with the tapestry-spring 5.0, including exposing Spring beans as Tapestry IoC services (something that no longer occurs unless compatibility mode is enabled).</p><h2 id="IntegratingwithSpringFramework-ChangesFrom5.0">Changes From 5.0</h2><p>The changes below represent an unfortunate backwards compatibility issue. If necessary, you can still use tapestry-spring version 5.0.18 with the rest of Tapestry.</p><ul class="alternate"><li>You may now use the @Inject or @InjectService annotations inside Spring beans; these will be resolved to Tapestry services or other objects available via the MasterObjectProvider. Please see the <a shape="rect" href="injection-in-detail.html">detailed guide to Injection</a>.</li><li>The dependency on Spring is no longer scope "provider" and has changed to 2.5.6.</li><li>Spring Beans are no longer exposed as services, 
 unless 5.0 compatibility mode is enabled.</li><li>You no longer create a ContextLoaderListener.</li></ul><h2 id="IntegratingwithSpringFramework-Limitations">Limitations</h2><p>Non-singleton beans are not handled properly. Tapestry will request the beans from the application context in a manner unsuitable for their life cycle. For the moment, you should consider the non-singleton beans to be not injectable. Instead, inject the ApplicationContext service and obtain the non-singleton beans as needed.</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/integration-testing.html
==============================================================================
--- websites/production/tapestry/content/integration-testing.html (original)
+++ websites/production/tapestry/content/integration-testing.html Sat Jan 18 18:21:05 2014
@@ -29,6 +29,7 @@
   <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
   <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
   <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
   <script type="text/javascript">
   SyntaxHighlighter.defaults['toolbar'] = false;
   SyntaxHighlighter.all();
@@ -69,15 +70,14 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><h1 id="IntegrationTesting-IntegrationTestingwithSelenium">Integration Testing with Selenium</h1>
-<div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
+<div id="ConfluenceContent"><h1 id="IntegrationTesting-IntegrationTestingwithSelenium">Integration Testing with Selenium</h1><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
 <h3>Related Articles</h3>
 <ul class="content-by-label"><li>
             <div>
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="integration-testing.html">Integration Testing</a>
+                            <a shape="rect" href="unit-testing-pages-or-components.html">Unit testing pages or components</a>
                     
                 
                             </div>
@@ -86,39 +86,19 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="unit-testing-pages-or-components.html">Unit testing pages or components</a>
+                            <a shape="rect" href="integration-testing.html">Integration Testing</a>
                     
                 
                             </div>
         </li></ul>
-</div>
-
-<p>The Tapestry Test Utilities is a small library to make it easier to build integration test suites around <a shape="rect" class="external-link" href="http://www.openqa.org/selenium/" >Selenium</a> version 2.14.0.</p>
-
-<p>The strategy is to start, in process, a Selenimum Server (which, in turn, starts and manages a web browser), a Jetty instance (for the web browser to talk to), and a Selenium client (which talks to the server).</p>
-
-<p>The client is able to request URLs, fill in form data, click links, and make assertions about output and behavior.</p>
-
-<h1 id="IntegrationTesting-Usage">Usage</h1>
-
-<p>The core part of this library is a base class for you to extend your tests classes : <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/test/SeleniumTestCase.html">SeleniumTestCase</a>.</p>
-
-<p>This class is responsible for starting an instance of Jetty to server your web application, as well as a copy of Selenium Server. It also implements the <a shape="rect" class="external-link" href="http://release.openqa.org/selenium-remote-control/0.9.0/doc/java/" >Selenium</a> interface.</p>
-
-    <div class="aui-message warning shadowed information-macro">
+</div><p>The Tapestry Test Utilities is a small library to make it easier to build integration test suites around <a shape="rect" class="external-link" href="http://www.openqa.org/selenium/" >Selenium</a> version 2.14.0.</p><p>The strategy is to start, in process, a Selenimum Server (which, in turn, starts and manages a web browser), a Jetty instance (for the web browser to talk to), and a Selenium client (which talks to the server).</p><p>The client is able to request URLs, fill in form data, click links, and make assertions about output and behavior.</p><h1 id="IntegrationTesting-Usage">Usage</h1><p>The core part of this library is a base class for you to extend your tests classes : <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/test/SeleniumTestCase.html">SeleniumTestCase</a>.</p><p>This class is responsible for starting an instance of Jetty to server your web application, as well as a copy of Selenium Server. It also i
 mplements the <a shape="rect" class="external-link" href="http://release.openqa.org/selenium-remote-control/0.9.0/doc/java/" >Selenium</a> interface.</p>    <div class="aui-message warning shadowed information-macro">
                             <span class="aui-icon icon-warning">Icon</span>
                 <div class="message-content">
-                            
-<p>Before Tapestry 5.2, your class should extend <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/test/AbstractIntegrationTestSuite.html">AbstractIntegrationTestSuite</a></p>
+                            <p>Before Tapestry 5.2, your class should extend <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/test/AbstractIntegrationTestSuite.html">AbstractIntegrationTestSuite</a></p>
                     </div>
     </div>
-
-
-<p>Here's an example from one of the Tapestry modules:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Your Integration Test Class : SinglePersistenceUnitIntegrationTest.java</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-package org.apache.tapestry5.jpa.integration.app2;
+<p>Here's an example from one of the Tapestry modules:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Your Integration Test Class : SinglePersistenceUnitIntegrationTest.java</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[package org.apache.tapestry5.jpa.integration.app2;
 
 import org.apache.tapestry5.test.SeleniumTestCase;
 import org.testng.annotations.Test;
@@ -137,23 +117,8 @@ public class SinglePersistenceUnitIntegr
     }
 }
 ]]></script>
-</div></div>
-
-<p>With the SeleniumTestCase class, you can use basic Selenium methods (such as open() and type()) and methods added by the SeleniumTestCase base class (clickAndWait() and assertFieldValue()).</p>
-
-<p>In addition, the SeleniumTestCase base class extends the normal exception reporting provided by Selenium; when a failure occurs inside Selenium server, a more detailed message, including the current page's HTML source, is reported to System.err.</p>
-
-<h1 id="IntegrationTesting-Configuration">Configuration</h1>
-
-<p>All the configuration of your Integration Tests should be in your testng.xml file. Tapestry provides some parameters, in order to have the right environment for your tests.</p>
-
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Parameter </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Value </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tapestry.web-app-folder </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> src/main/webapp </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The path to a web app </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tapestry.servlet-container </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> jetty7 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the server container to use for the integration tests (jetty7 or tomcat6) </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tapestry.context-path </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p>
 </td><td colspan="1" rowspan="1" class="confluenceTd"><p> The context path </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tapestry.port </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 9090 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The web server port </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tapestry.ssl-port </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> 8443 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The web server ssl port </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> tapestry.browser-start-command </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> *firefox </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The browser command to pass to Selenium </p></td></tr></tbody></table></div>
-
-
-<p>Here's an example :</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>testng.xml</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;suite name=&quot;Selenium Tests Suite&quot; annotations=&quot;1.5&quot;&gt;
+</div></div><p>With the SeleniumTestCase class, you can use basic Selenium methods (such as open() and type()) and methods added by the SeleniumTestCase base class (clickAndWait() and assertFieldValue()).</p><p>In addition, the SeleniumTestCase base class extends the normal exception reporting provided by Selenium; when a failure occurs inside Selenium server, a more detailed message, including the current page's HTML source, is reported to System.err.</p><h1 id="IntegrationTesting-Configuration">Configuration</h1><p>All the configuration of your Integration Tests should be in your testng.xml file. Tapestry provides some parameters, in order to have the right environment for your tests.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Parameter</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="
 1" rowspan="1" class="confluenceTd"><p>tapestry.web-app-folder</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>src/main/webapp</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The path to a web app</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>tapestry.servlet-container</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>jetty7</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the server container to use for the integration tests (jetty7 or tomcat6)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>tapestry.context-path</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The context path</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>tapestry.port</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>9090</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The web server port</p></td></tr><tr
 ><td colspan="1" rowspan="1" class="confluenceTd"><p>tapestry.ssl-port</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>8443</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The web server ssl port</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>tapestry.browser-start-command</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>*firefox</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The browser command to pass to Selenium</p></td></tr></tbody></table></div><p>Here's an example :</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>testng.xml</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;suite name=&quot;Selenium Tests Suite&quot; annotations=&quot;1.5&quot;&gt;
   &lt;test name=&quot;Integration Tests&quot; enabled=&quot;true&quot;&gt;
     &lt;parameter name=&quot;tapestry.browser-start-command&quot; value=&quot;*googlechrome&quot; /&gt;
     &lt;parameter name=&quot;tapestry.port&quot; value=&quot;9091&quot; /&gt;
@@ -164,13 +129,7 @@ public class SinglePersistenceUnitIntegr
   &lt;/test&gt;
 &lt;/suite&gt;
 ]]></script>
-</div></div>
-
-<h1 id="IntegrationTesting-SomeInterestingTools">Some Interesting Tools</h1>
-
-<p>Here are some interesting plugins you can use to write your integration tests.</p>
-
-<ul><li>Google Chrome : <a shape="rect" class="external-link" href="https://chrome.google.com/webstore/detail/ikbfbhbdjpjnalaooidkdbgjknhghhbo" >xpathOnClick</a></li><li>FireFox : <a shape="rect" class="external-link" href="http://seleniumhq.org/projects/ide/" >Selenium IDE</a></li></ul></div>
+</div></div><h1 id="IntegrationTesting-SomeInterestingTools">Some Interesting Tools</h1><p>Here are some interesting plugins you can use to write your integration tests.</p><ul><li>Google Chrome : <a shape="rect" class="external-link" href="https://chrome.google.com/webstore/detail/ikbfbhbdjpjnalaooidkdbgjknhghhbo" >xpathOnClick</a></li><li>FireFox : <a shape="rect" class="external-link" href="http://seleniumhq.org/projects/ide/" >Selenium IDE</a></li></ul></div>
 </div>
 
 <div class="clearer"></div>