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 18:20:53 UTC

svn commit: r894641 [4/4] - in /websites/production/tapestry/content: cache/main.pageCache component-parameters.html configuration.html download.html exploring-the-project.html type-coercion.html using-tapestry-with-hibernate.html

Modified: websites/production/tapestry/content/exploring-the-project.html
==============================================================================
--- websites/production/tapestry/content/exploring-the-project.html (original)
+++ websites/production/tapestry/content/exploring-the-project.html Sat Jan 18 17:20:52 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();
@@ -77,18 +78,8 @@ table.ScrollbarTable td.ScrollbarParent 
 table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
 table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
 
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="loading-the-project-into-eclipse.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="loading-the-project-into-eclipse.html">Loading the Project Into Eclipse</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo Guessing Game</a></td><td colspa
 n="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="implementing-the-hi-lo-guessing-game.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div>
-
-<p>The layout of the project follows the sensible standards promoted by Maven:</p>
-
-<ul><li>Java source files under <code>src/main/java</code></li><li>Web application files under <code>src/main/webapp</code> (including <code>src/main/webapp/WEB-INF</code>)</li><li>Java test sources under <code>src/test/java</code></li><li>Non-code resources (including Tapestry page and component templates) under <code>src/main/resources</code> and <code>src/test/resources</code></li></ul>
-
-
-<p>Let's look at what Maven has created from the archetype, starting with the web.xml configuration file:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/webapp/WEB-INF/web.xml</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="loading-the-project-into-eclipse.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="loading-the-project-into-eclipse.html">Loading the Project Into Eclipse</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo Guessing Game</a></td><td colspa
 n="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="implementing-the-hi-lo-guessing-game.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div><p>The layout of the project follows the sensible standards promoted by Maven:</p><ul><li>Java source files under <code>src/main/java</code></li><li>Web application files under <code>src/main/webapp</code> (including <code>src/main/webapp/WEB-INF</code>)</li><li>Java test sources under <code>src/test/java</code></li><li>Non-code resources (including Tapestry page and component templates) under <code>src/main/resources</code> and <code>src/test/resources</code></li></ul><p>Let's look at what Maven has created from the archetype, starting with the web.xml configuration file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/webapp/WEB-INF
 /web.xml</b></div><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;!DOCTYPE web-app
         PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
         &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;
@@ -127,25 +118,8 @@ of where to look for pages, components a
     &lt;/filter-mapping&gt;
 &lt;/web-app&gt;
 ]]></script>
-</div></div>
-
-<p>This is short and sweet: you can see that the package name you provided earlier shows up as the <code>tapestry.app-package</code> context parameter; the TapestryFilter instance will use this information to locate the Java classes for pages and components.</p>
-
-<p>Tapestry 5 operates as a <em>servlet filter</em> rather than as a traditional <em>servlet</em>. In this way, Tapestry has a chance to intercept all incoming requests, to determine which ones apply to Tapestry pages (or other resources). The net effect is that you don't have to maintain any additional configuration for Tapestry to operate, regardless of how many pages or components you add to your application.</p>
-
-<p>Much of the rest of web.xml is configuration to match Tapestry execution modes against module classes. An execution mode defines how the application is being run: the default execution mode is "production", but the web.xml defines two additional modes: "development" and "qa" (for "Quality Assurance"). The module classes indicated will be loaded for those execution modes, and can change the configuration of the application is various ways. We'll come back to execution modes and module classes later in the tutorial.</p>
-
-<p>Tapestry pages minimally consist of an ordinary Java class plus a component template file.</p>
-
-<p>In the root of your web application, a page named "Index" will be used for any request that specifies no additional path after the context name.  </p>
-
-<h1 id="ExploringtheProject-IndexJavaClass">Index Java Class</h1>
-
-<p>Tapestry has very specific rules for where page classes go. Tapestry adds a sub-package, "pages", to the root application package ("com.example.tutorial"); the Java classes for pages goes there. Thus the full Java class name is com.example.tutorial.pages.Index.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/Index.java</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-package com.example.tutorial.pages;
+</div></div><p>This is short and sweet: you can see that the package name you provided earlier shows up as the <code>tapestry.app-package</code> context parameter; the TapestryFilter instance will use this information to locate the Java classes for pages and components.</p><p>Tapestry 5 operates as a <em>servlet filter</em> rather than as a traditional <em>servlet</em>. In this way, Tapestry has a chance to intercept all incoming requests, to determine which ones apply to Tapestry pages (or other resources). The net effect is that you don't have to maintain any additional configuration for Tapestry to operate, regardless of how many pages or components you add to your application.</p><p>Much of the rest of web.xml is configuration to match Tapestry execution modes against module classes. An execution mode defines how the application is being run: the default execution mode is "production", but the web.xml defines two additional modes: "development" and "qa" (for "Quality Assurance")
 . The module classes indicated will be loaded for those execution modes, and can change the configuration of the application is various ways. We'll come back to execution modes and module classes later in the tutorial.</p><p>Tapestry pages minimally consist of an ordinary Java class plus a component template file.</p><p>In the root of your web application, a page named "Index" will be used for any request that specifies no additional path after the context name.</p><h1 id="ExploringtheProject-IndexJavaClass">Index Java Class</h1><p>Tapestry has very specific rules for where page classes go. Tapestry adds a sub-package, "pages", to the root application package ("com.example.tutorial"); the Java classes for pages goes there. Thus the full Java class name is com.example.tutorial.pages.Index.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/Index.java</b></div><
 div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages;
 
 import java.util.Date;
 import org.apache.tapestry5.annotations.*;
@@ -196,28 +170,7 @@ public class Index
     }
 }
 ]]></script>
-</div></div>
-
-<p>There's a bit going on in this listing, as the Index page attempts to demonstrate a bunch of different ideas in Tapestry.  Even so, the class is essentially pretty simple: Tapestry pages and components have no base classes to extend, no interfaces to implement, and are just a very pure POJO (Plain Old Java Object) ... with some special naming conventions and annotations for fields and methods.</p>
-
-<p>You do have to meet the Tapestry framework partway:</p>
-
-<ul><li>You need to put the Java class in the expected package, here com.example.tutorial.pages</li><li>The class must be public</li><li>You need to make sure there's a public, no-arguments constructor (here, the Java compiler has silently provided one for us)</li><li>All non-static fields must be <strong>private</strong></li></ul>
-
-
-<p>As we saw when running the application, the page displays the current date and time, as well as a couple of extra links. The <code>currentTime</code> property is where that value comes from; shortly we'll see how that value is referenced in the template, so it can be extracted from the page and output.</p>
-
-<p>Tapestry always matches a page class to a template; neither is functional without the other.  In fact, components within a page are treated the same way (except that components do not always have templates).</p>
-
-<p>You will often hear about the <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Model_view_controller" >Model-View-Controller pattern</a> (MVC).  In Tapestry, the page class acts as both the Model (the source of data) and the controller (the logic that responds to user interaction).  The template is the View in MVC.  As a model, the page exposes JavaBeans properties that can be referenced in the template.</p>
-
-<p>Let's look at how the component template builds on the Java class to provide the full user interface.</p>
-
-<h1 id="ExploringtheProject-ComponentTemplate">Component Template</h1>
-
-<p>Tapestry pages are the combination of a POJO Java class with a Tapestry component template. The template has the same name as the Java class, but has the extension <code>.tml</code>. Since the Java class here is com.example.tutorial.pages.Index, the template file will be located at src/main/resource/com/example/tutorial/pages/Index.tml.  Ultimately, both the Java class and the component template file will be stored in the same folder within the deployed WAR file.</p>
-
-<p>Tapestry component templates are well-formed XML documents. This means that you can use any available XML editor. Templates may even have a DOCTYPE or an XML schema to validate the structure of the template page</p><p>&lt;style type='text/css'&gt;
+</div></div><p>There's a bit going on in this listing, as the Index page attempts to demonstrate a bunch of different ideas in Tapestry. Even so, the class is essentially pretty simple: Tapestry pages and components have no base classes to extend, no interfaces to implement, and are just a very pure POJO (Plain Old Java Object) ... with some special naming conventions and annotations for fields and methods.</p><p>You do have to meet the Tapestry framework partway:</p><ul><li>You need to put the Java class in the expected package, here com.example.tutorial.pages</li><li>The class must be public</li><li>You need to make sure there's a public, no-arguments constructor (here, the Java compiler has silently provided one for us)</li><li>All non-static fields must be <strong>private</strong></li></ul><p>As we saw when running the application, the page displays the current date and time, as well as a couple of extra links. The <code>currentTime</code> property is where that value comes from
 ; shortly we'll see how that value is referenced in the template, so it can be extracted from the page and output.</p><p>Tapestry always matches a page class to a template; neither is functional without the other. In fact, components within a page are treated the same way (except that components do not always have templates).</p><p>You will often hear about the <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Model_view_controller" >Model-View-Controller pattern</a> (MVC). In Tapestry, the page class acts as both the Model (the source of data) and the controller (the logic that responds to user interaction). The template is the View in MVC. As a model, the page exposes JavaBeans properties that can be referenced in the template.</p><p>Let's look at how the component template builds on the Java class to provide the full user interface.</p><h1 id="ExploringtheProject-ComponentTemplate">Component Template</h1><p>Tapestry pages are the combination of a POJO Java 
 class with a Tapestry component template. The template has the same name as the Java class, but has the extension <code>.tml</code>. Since the Java class here is com.example.tutorial.pages.Index, the template file will be located at src/main/resource/com/example/tutorial/pages/Index.tml. Ultimately, both the Java class and the component template file will be stored in the same folder within the deployed WAR file.</p><p>Tapestry component templates are well-formed XML documents. This means that you can use any available XML editor. Templates may even have a DOCTYPE or an XML schema to validate the structure of the template page</p>&lt;style type='text/css'&gt;
 .FootnoteMarker, .FootnoteNum a {
   background: transparent url(/confluence/download/resources/com.adaptavist.confluence.footnoteMacros:footnote/gfx/footnote.png) no-repeat top right;
   padding: 1px 2px 0px 1px;
@@ -289,13 +242,8 @@ var footnoteMarkerHighlight = function(i
             1
     </a>
 </sup>
-</p>.<p></p>
-
-<p>For the most part, a Tapestry component template looks like ordinary XHTML:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/Index.tml</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;html t:type=&quot;layout&quot; title=&quot;tutorial1 Index&quot;
+<p>.</p><p>&#160;</p><p>For the most part, a Tapestry component template looks like ordinary XHTML:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/Index.tml</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;html t:type=&quot;layout&quot; title=&quot;tutorial1 Index&quot;
       t:sidebarTitle=&quot;Framework Version&quot;
       xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_3.xsd&quot;
       xmlns:p=&quot;tapestry:parameter&quot;&gt;
@@ -338,177 +286,85 @@ var footnoteMarkerHighlight = function(i
 
 &lt;/html&gt;
 ]]></script>
-</div></div>
-
-    <div class="aui-message success shadowed information-macro">
+</div></div>    <div class="aui-message success shadowed information-macro">
                             <span class="aui-icon icon-success">Icon</span>
                 <div class="message-content">
-                            
-<p>You do have to name your component template file, Index.tml, with the <strong>exact same case</strong> as the component class name, Index. If you get the case wrong, it may work on some operating systems (such as Mac OS X, Windows) and not on others (Linux, and most others). This can be really vexing, as it is common to develop on Windows and deploy on Linux or Solaris, so be careful about case in this one area.</p>
+                            <p>You do have to name your component template file, Index.tml, with the <strong>exact same case</strong> as the component class name, Index. If you get the case wrong, it may work on some operating systems (such as Mac OS X, Windows) and not on others (Linux, and most others). This can be really vexing, as it is common to develop on Windows and deploy on Linux or Solaris, so be careful about case in this one area.</p>
                     </div>
     </div>
-
-
-<p>The goal in Tapestry is for component templates, such as Index.tml, to look as much as possible like ordinary, static HTML files</p><p>
+<p>The goal in Tapestry is for component templates, such as Index.tml, to look as much as possible like ordinary, static HTML files</p>
 <sup id="FootnoteMarker2">
     <a shape="rect" class="FootnoteMarker" name="FootnoteMarker2" href="#Footnote2" onclick="footnoteHighlight(&quot;2&quot;,true);" alt="Footnote: Click here to display the footnote" title="Footnote: Click here to display the footnote">
             2
     </a>
 </sup>
-</p>. In fact, the expectation is that in many cases, the templates will start as static HTML files, created by a web developer, and then be <em>instrumented</em> to act as live Tapestry pages.<p></p>
-
-<p>Tapestry hides non-standard elements and attributes inside XML namespaces. By convention, the prefix "t:" is used for the primary namespace, but that is not a requirement, any prefix you want to use is fine.</p>
-
-<p>This short template demonstrates quite a few features of Tapestry.</p>
-
-    <div class="aui-message problem shadowed information-macro">
+<p>. In fact, the expectation is that in many cases, the templates will start as static HTML files, created by a web developer, and then be <em>instrumented</em> to act as live Tapestry pages.</p><p>&#160;</p><p>Tapestry hides non-standard elements and attributes inside XML namespaces. By convention, the prefix "t:" is used for the primary namespace, but that is not a requirement, any prefix you want to use is fine.</p><p>This short template demonstrates quite a few features of Tapestry.</p>    <div class="aui-message problem shadowed information-macro">
                             <span class="aui-icon icon-problem">Icon</span>
                 <div class="message-content">
-                            
-<p>Part of the concept of the quickstart archetype is to demonstrate a bunch of different features, approaches and common patterns used in Tapestry, thus we're hitting you with a lot all at once.</p>
+                            <p>Part of the concept of the quickstart archetype is to demonstrate a bunch of different features, approaches and common patterns used in Tapestry, thus we're hitting you with a lot all at once.</p>
                     </div>
     </div>
-
-
-<p>First of all, there are two XML namespaces defined:</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[
-  xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_3.xsd&quot;
+<p>First of all, there are two XML namespaces defined:</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[  xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_3.xsd&quot;
   xmlns:p=&quot;tapestry:parameter&quot;
 ]]></script>
-</div></div>
-
-<p>The first namespace, "t:", it used to identify Tapestry-specific elements and attributes.  Although there is an XSD (that is, a XML schema definition), it is incomplete (for reasons explained shortly).</p>
-
-<p>The second namespace, "p:", is a way of marking a chunk of the template as a parameter passed into another component. We'll expand on that shortly.</p>
-
-<p>A Tapestry component template consists mostly of standard XHTML that will pass down to the client web browser unchanged.  The dynamic aspects of the template are represented by <em>components</em> and <em>expansions</em>.</p>
-
-<h1 id="ExploringtheProject-ExpansionsinTemplates">Expansions in Templates</h1>
-
-<p>Let's start with expansions. Expansions are an easy way of including some dynamic output when rendering the page.  By default, an expansion refers to a JavaBeans property of the page:</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;p&gt;The current time is: ${currentTime}&lt;/p&gt;
+</div></div><p>The first namespace, "t:", it used to identify Tapestry-specific elements and attributes. Although there is an XSD (that is, a XML schema definition), it is incomplete (for reasons explained shortly).</p><p>The second namespace, "p:", is a way of marking a chunk of the template as a parameter passed into another component. We'll expand on that shortly.</p><p>A Tapestry component template consists mostly of standard XHTML that will pass down to the client web browser unchanged. The dynamic aspects of the template are represented by <em>components</em> and <em>expansions</em>.</p><h1 id="ExploringtheProject-ExpansionsinTemplates">Expansions in Templates</h1><p>Let's start with expansions. Expansions are an easy way of including some dynamic output when rendering the page. By default, an expansion refers to a JavaBeans property of the page:</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;p&gt;The current time is: ${currentTime}&lt;/p&gt;
 ]]></script>
-</div></div>
-
-    <div class="aui-message success shadowed information-macro">
+</div></div>    <div class="aui-message success shadowed information-macro">
                             <span class="aui-icon icon-success">Icon</span>
                 <div class="message-content">
-                            
-<p>If you are coming to Tapestry 5 from Tapestry 4 or earlier, expansions are a concise replacement for the Insert component.</p>
+                            <p>If you are coming to Tapestry 5 from Tapestry 4 or earlier, expansions are a concise replacement for the Insert component.</p>
                     </div>
     </div>
-
-
-<p>The value inside the curly braces is a <em>property expression</em>.  Tapestry uses its own property expression language that is expressive, fast, and type-safe</p><p>
+<p>The value inside the curly braces is a <em>property expression</em>. Tapestry uses its own property expression language that is expressive, fast, and type-safe</p>
 <sup id="FootnoteMarker3">
     <a shape="rect" class="FootnoteMarker" name="FootnoteMarker3" href="#Footnote3" onclick="footnoteHighlight(&quot;3&quot;,true);" alt="Footnote: Click here to display the footnote" title="Footnote: Click here to display the footnote">
             3
     </a>
 </sup>
-</p>. More advanced property expressions can traverse multiple properties (for example, <code>user.address.city</code>), or even invoke public methods.  Here the expansion simply reads the <code>currentTime</code> property of the page.<p></p>
-
-<p>Tapestry follows the rules defined by Sun's JavaBeans specification: a property name of <code>currentTime</code> maps to two methods: <code>getCurrentTime()</code> and <code>setCurrentTime()</code>. If you omit one or the other of these methods, the property is either read only (as here), or write only</p><p>
+<p>. More advanced property expressions can traverse multiple properties (for example, <code>user.address.city</code>), or even invoke public methods. Here the expansion simply reads the <code>currentTime</code> property of the page.</p><p>&#160;</p><p>Tapestry follows the rules defined by Sun's JavaBeans specification: a property name of <code>currentTime</code> maps to two methods: <code>getCurrentTime()</code> and <code>setCurrentTime()</code>. If you omit one or the other of these methods, the property is either read only (as here), or write only</p>
 <sup id="FootnoteMarker4">
     <a shape="rect" class="FootnoteMarker" name="FootnoteMarker4" href="#Footnote4" onclick="footnoteHighlight(&quot;4&quot;,true);" alt="Footnote: Click here to display the footnote" title="Footnote: Click here to display the footnote">
             4
     </a>
 </sup>
-</p>.<p></p>
-
-<p>Tapestry does go one step further: it ignores case when matching properties inside the expansion to properties of the page. In the template we could say ${currenttime} or ${CurrentTime} or any variation, and Tapestry will <em>still</em> invoke the <code>getCurrentTime()</code> method.</p>
-
-<p>Note that in Tapestry it is not necessary to configure what object holds the <code>currentTime</code> property; a template and a page are always used in combination with each other; expressions are always rooted in the page instance, in this case, an instance of the Index class. </p>
-
-<p>The Index.tml template includes a second expansion:</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;p&gt;${message:greeting}&lt;/p&gt;
+<p>.</p><p>&#160;</p><p>Tapestry does go one step further: it ignores case when matching properties inside the expansion to properties of the page. In the template we could say ${currenttime} or ${CurrentTime} or any variation, and Tapestry will <em>still</em> invoke the <code>getCurrentTime()</code> method.</p><p>Note that in Tapestry it is not necessary to configure what object holds the <code>currentTime</code> property; a template and a page are always used in combination with each other; expressions are always rooted in the page instance, in this case, an instance of the Index class.</p><p>The Index.tml template includes a second expansion:</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;p&gt;${message:greeting}&lt;/p&gt;
 ]]></script>
-</div></div>
-
-<p>Here <code>greeting</code> is not a property of the page; its actually a localized message key. Every Tapestry page and component is allowed to have its own message catalog</p><p>
+</div></div><p>Here <code>greeting</code> is not a property of the page; its actually a localized message key. Every Tapestry page and component is allowed to have its own message catalog</p>
 <sup id="FootnoteMarker5">
     <a shape="rect" class="FootnoteMarker" name="FootnoteMarker5" href="#Footnote5" onclick="footnoteHighlight(&quot;5&quot;,true);" alt="Footnote: Click here to display the footnote" title="Footnote: Click here to display the footnote">
             5
     </a>
 </sup>
-</p>.<p></p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/Index.properties</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-greeting=Welcome to Tapestry 5!  We hope that this project template will get you going in style.
+<p>.</p><p>&#160;</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/Index.properties</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[greeting=Welcome to Tapestry 5!  We hope that this project template will get you going in style.
 ]]></script>
-</div></div>
-
-<p>Message catalogs are useful for storing repeating strings outside of code or templates, though their primary purpose is related to localization of the application (which will be described in more detail in a later chapter). Messages that may be used across multiple pages can be stored in the application's global message catalog, src/main/webapp/WEB-INF/app.properties, instead.</p>
-
-<p>This "message:" prefix is not some special case; there are actually quite a few of these <em>binding prefixes</em> built into Tapestry, each  having a specific purpose. In fact, omitting a binding prefix in an expansion is exactly the same as using the "prop:" binding prefix, which means to treat the binding as a property expression.</p>
-
-<p>Expansions are useful for extracting a piece of information and rendering it out to the client as a string, but the real heavy lifting of Tapestry occurs inside components.</p>
-
-<h1 id="ExploringtheProject-ComponentsInsideTemplates">Components Inside Templates</h1>
-
-<p>Components can be represented inside a component template in two ways</p><p>
+</div></div><p>Message catalogs are useful for storing repeating strings outside of code or templates, though their primary purpose is related to localization of the application (which will be described in more detail in a later chapter). Messages that may be used across multiple pages can be stored in the application's global message catalog, src/main/webapp/WEB-INF/app.properties, instead.</p><p>This "message:" prefix is not some special case; there are actually quite a few of these <em>binding prefixes</em> built into Tapestry, each having a specific purpose. In fact, omitting a binding prefix in an expansion is exactly the same as using the "prop:" binding prefix, which means to treat the binding as a property expression.</p><p>Expansions are useful for extracting a piece of information and rendering it out to the client as a string, but the real heavy lifting of Tapestry occurs inside components.</p><h1 id="ExploringtheProject-ComponentsInsideTemplates">Components Inside Templa
 tes</h1><p>Components can be represented inside a component template in two ways</p>
 <sup id="FootnoteMarker6">
     <a shape="rect" class="FootnoteMarker" name="FootnoteMarker6" href="#Footnote6" onclick="footnoteHighlight(&quot;6&quot;,true);" alt="Footnote: Click here to display the footnote" title="Footnote: Click here to display the footnote">
             6
     </a>
 </sup>
-</p>:<p></p>
-
-<ul><li>As an ordinary element, but with a t:type attribute to define the type of component.</li></ul>
-
-
-<ul><li>As an element in the Tapestry namespace, in which case the element name determines the type.</li></ul>
-
-
-<p>Here we've used an &lt;html&gt; element to represent the application's Layout component.</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;html t:type=&quot;layout&quot; ...&gt; 
+<p>:</p><p>&#160;</p><ul><li>As an ordinary element, but with a t:type attribute to define the type of component.</li></ul><ul><li>As an element in the Tapestry namespace, in which case the element name determines the type.</li></ul><p>Here we've used an &lt;html&gt; element to represent the application's Layout component.</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;html t:type=&quot;layout&quot; ...&gt; 
   ...
 &lt;/html&gt;
 ]]></script>
-</div></div>
-
-<p>But for the PageLink component, we've used an element in the Tapestry namespace:</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;t:pagelink page=&quot;Index&quot;&gt;refresh page&lt;/t:pagelink&gt;
+</div></div><p>But for the PageLink component, we've used an element in the Tapestry namespace:</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;t:pagelink page=&quot;Index&quot;&gt;refresh page&lt;/t:pagelink&gt;
 ]]></script>
-</div></div>
-
-<p>Which form you select is a matter of choice. In the vast majority of cases, they are exactly equivalent.</p>
-
-<p>As elsewhere, case is ignored.  Here the types ("layout" and "pagelink") were in all lower case; the actual class names are Layout and PageLink.  Further, Tapestry "blends" the core library components in with the components defined by this application; thus type "layout" is mapped to application component class com.example.tutorial.components.Layout, but "pagelink" is mapped to Tapestry's built-in org.apache.tapestry5.corelib.components.PageLink class.</p>
-
-<p>Tapestry components are configured using parameters; for each component, there is a set of parameters, each with a specific type and purpose. Some parameters are required, others are optional. Attributes of the element are used to <em>bind</em> parameters to specific literal values, or to page properties.  Tapestry is flexible here as well; you can always place an attribute in the Tapestry namespace (using the "t:" prefix), but in most cases, this is unnecessary.</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;html t:type=&quot;layout&quot; title=&quot;tutorial1 Index&quot;
+</div></div><p>Which form you select is a matter of choice. In the vast majority of cases, they are exactly equivalent.</p><p>As elsewhere, case is ignored. Here the types ("layout" and "pagelink") were in all lower case; the actual class names are Layout and PageLink. Further, Tapestry "blends" the core library components in with the components defined by this application; thus type "layout" is mapped to application component class com.example.tutorial.components.Layout, but "pagelink" is mapped to Tapestry's built-in org.apache.tapestry5.corelib.components.PageLink class.</p><p>Tapestry components are configured using parameters; for each component, there is a set of parameters, each with a specific type and purpose. Some parameters are required, others are optional. Attributes of the element are used to <em>bind</em> parameters to specific literal values, or to page properties. Tapestry is flexible here as well; you can always place an attribute in the Tapestry namespace (using t
 he "t:" prefix), but in most cases, this is unnecessary.</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;html t:type=&quot;layout&quot; title=&quot;tutorial1 Index&quot;
       t:sidebarTitle=&quot;Framework Version&quot; ...
 ]]></script>
-</div></div>
-
-<p>This binds two parameters, <code>title</code> and <code>sidebarTitle</code>, of the Layout component to the literal strings "tutorial1 Index" and "Current Time", respectively.</p>
-
-<p>The Layout component will actually provide the bulk of the HTML ultimately sent to the browser; we'll look at its template in a later chapter. The point is, the page's template is integrated into the Layout component's template. The following diagram shows how parameters passed to the Layout component end up rendered in the final page:</p>
-
-    
+</div></div><p>This binds two parameters, <code>title</code> and <code>sidebarTitle</code>, of the Layout component to the literal strings "tutorial1 Index" and "Current Time", respectively.</p><p>The Layout component will actually provide the bulk of the HTML ultimately sent to the browser; we'll look at its template in a later chapter. The point is, the page's template is integrated into the Layout component's template. The following diagram shows how parameters passed to the Layout component end up rendered in the final page:</p><p>    
 
 
 
 
-<span class="gliffy-container" id="gliffy-container-24346949-808" data-fullwidth="913" data-ceoid="24188263" data-filename="Templates and Parameters">
+<span class="gliffy-container" id="gliffy-container-24346949-4298" data-fullwidth="913" data-ceoid="24188263" data-filename="Templates and Parameters">
 
             
 <span class="gliffy-chrome-container">
@@ -528,45 +384,24 @@ greeting=Welcome to Tapestry 5!  We hope
             </span>
 </span>
     
-    <map id="gliffy-map-24346949-995" name="gliffy-map-24346949-995"></map>
+    <map id="gliffy-map-24346949-5266" name="gliffy-map-24346949-5266"></map>
 
-    <img class="gliffy-image gliffy-image-border" id="gliffy-image-24346949-808" width="304" height="300" data-full-width="913" data-full-height="901" src="https://cwiki.apache.org/confluence/download/attachments/24188263/Templates%20and%20Parameters.png?version=2&amp;modificationDate=1371888025000&amp;api=v2" usemap="#gliffy-map-24346949-995">
+    <img class="gliffy-image gliffy-image-border" id="gliffy-image-24346949-4298" width="304" height="300" data-full-width="913" data-full-height="901" src="https://cwiki.apache.org/confluence/download/attachments/24188263/Templates%20and%20Parameters.png?version=2&amp;modificationDate=1371888025000&amp;api=v2" usemap="#gliffy-map-24346949-5266">
 
-    <map class="gliffy-dynamic" id="gliffy-dynamic-map-24346949-808" name="gliffy-dynamic-map-24346949-808"></map>
+    <map class="gliffy-dynamic" id="gliffy-dynamic-map-24346949-4298" name="gliffy-dynamic-map-24346949-4298"></map>
 </span>
 
 
-
-
-<p>The interesting point here (and this is an advanced concept in Tapestry, one we'll return to later) is that we can pass a chunk of the Index.tml template to the Layout component as the <code>sidebar</code> parameter. That's what the tapestry:parameter namespace (the "p:" prefix) is for; the element name is matched against a parameter of the component and the entire block of the template is passed into the Layout component ... which decides where, inside <em>its</em> template, that block gets rendered.</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;t:pagelink page=&quot;Index&quot;&gt;refresh&lt;/t:pagelink&gt;
+</p><p>The interesting point here (and this is an advanced concept in Tapestry, one we'll return to later) is that we can pass a chunk of the Index.tml template to the Layout component as the <code>sidebar</code> parameter. That's what the tapestry:parameter namespace (the "p:" prefix) is for; the element name is matched against a parameter of the component and the entire block of the template is passed into the Layout component ... which decides where, inside <em>its</em> template, that block gets rendered.</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;t:pagelink page=&quot;Index&quot;&gt;refresh&lt;/t:pagelink&gt;
 ]]></script>
-</div></div>
-
-<p>This time, it's the <code>page</code> parameter of the PageLink component that is bound, to the literal value "Index" (which is the name of this page). This gets rendered as a URL that re-renders the page, which is how the current time gets updated.  You can also create links to other pages in the application and, as we'll see in later chapters, attach additional information to the URL beyond just the page name.</p>
-
-<h1 id="ExploringtheProject-AMagicTrick">A Magic Trick</h1>
-
-<p>Now it's time for a magic trick. Edit Index.java and change the <code>getCurrentTime()</code> method to:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.java (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  public String getCurrentTime()
+</div></div><p>This time, it's the <code>page</code> parameter of the PageLink component that is bound, to the literal value "Index" (which is the name of this page). This gets rendered as a URL that re-renders the page, which is how the current time gets updated. You can also create links to other pages in the application and, as we'll see in later chapters, attach additional information to the URL beyond just the page name.</p><h1 id="ExploringtheProject-AMagicTrick">A Magic Trick</h1><p>Now it's time for a magic trick. Edit Index.java and change the <code>getCurrentTime()</code> method to:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.java (partial)</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[  public String getCurrentTime()
   {
     return &quot;A great day to learn Tapestry&quot;;
   }
 ]]></script>
-</div></div>
-
-<p>Make sure you save changes; then click the refresh link in the web browser:</p>
-
-
-<p><img class="confluence-embedded-image confluence-thumbnail" src="exploring-the-project.thumbs/app-live-reload.png" data-image-src="/confluence/download/attachments/24188263/app-live-reload.png?version=2&amp;modificationDate=1321974913000&amp;api=v2"></p>
-
-<div class="navmenu" style="float:right; width:30%; background:white; margin:3px; padding:3px">
+</div></div><p>Make sure you save changes; then click the refresh link in the web browser:</p><p><img class="confluence-embedded-image confluence-thumbnail" src="exploring-the-project.thumbs/app-live-reload.png" data-image-src="/confluence/download/attachments/24188263/app-live-reload.png?version=2&amp;modificationDate=1321974913000&amp;api=v2"></p><div class="navmenu" style="float:right; width:30%; background:white; margin:3px; padding:3px">
     <div class="aui-message warning shadowed information-macro">
                             <span class="aui-icon icon-warning">Icon</span>
                 <div class="message-content">
@@ -574,36 +409,13 @@ greeting=Welcome to Tapestry 5!  We hope
 <p>If Live Class Reloading isn't working for you, check the Troubleshooting section at <a shape="rect" href="class-reloading.html" title="Class Reloading">Class Reloading</a>.</p>
                     </div>
     </div>
-</div>
-<p>This is one of Tapestry's early <em>wow factor</em> features: changes to your component classes are picked up immediately (a feature we call Live Class Reloading). No restart. No re-deploy. Make the changes and see them <em>now</em>. Nothing should slow you down or get in the way of you getting your job done.</p>
-
-<p>But ... what if you make a mistake? What if you got the name in the template wrong.  Give it a try; in the template, change ${currentTime} to, say, ${currenTime}, and see what you get:</p>
-
-<p><img class="confluence-embedded-image confluence-thumbnail" src="exploring-the-project.thumbs/app-error-1.png" data-image-src="/confluence/download/attachments/24188263/app-error-1.png?version=1&amp;modificationDate=1291068475000&amp;api=v2"></p>
-
-<p>This is Tapestry's exception report page.  It's quite detailed.  It clearly identifies what Tapestry was doing, and relates the problem to a specific line in the template, which is shown in context. Tapestry always expands out the entire stack of exceptions, because it is so common for exceptions to be thrown, caught, and re-thrown inside other exceptions. In fact, if we scroll down just a little bit, we see more detail about this exception, plus a little bit of help:</p>
-
-<p><img class="confluence-embedded-image confluence-thumbnail" src="exploring-the-project.thumbs/app-error-2.png" data-image-src="/confluence/download/attachments/24188263/app-error-2.png?version=1&amp;modificationDate=1291068475000&amp;api=v2"></p>
-
-<p>This is part of Tapestry's way: it not only spells out exactly what it was doing and what went wrong, but it even helps you find a solution; here it tells you the names of properties you could have used.</p>
-
-<p>Tapestry displays the stack trace of the deepest exception, along with lots of details about the run-time environment: details about the current request, the HttpSession (if one exists), and even a detailed list of all JVM system properties.  Scroll down to see all this information.</p>
-
-
-    <div class="aui-message hint shadowed information-macro">
+</div><p>This is one of Tapestry's early <em>wow factor</em> features: changes to your component classes are picked up immediately (a feature we call Live Class Reloading). No restart. No re-deploy. Make the changes and see them <em>now</em>. Nothing should slow you down or get in the way of you getting your job done.</p><p>But ... what if you make a mistake? What if you got the name in the template wrong. Give it a try; in the template, change ${currentTime} to, say, ${currenTime}, and see what you get:</p><p><img class="confluence-embedded-image confluence-thumbnail" src="exploring-the-project.thumbs/app-error-1.png" data-image-src="/confluence/download/attachments/24188263/app-error-1.png?version=1&amp;modificationDate=1291068475000&amp;api=v2"></p><p>This is Tapestry's exception report page. It's quite detailed. It clearly identifies what Tapestry was doing, and relates the problem to a specific line in the template, which is shown in context. Tapestry always expands out the ent
 ire stack of exceptions, because it is so common for exceptions to be thrown, caught, and re-thrown inside other exceptions. In fact, if we scroll down just a little bit, we see more detail about this exception, plus a little bit of help:</p><p><img class="confluence-embedded-image confluence-thumbnail" src="exploring-the-project.thumbs/app-error-2.png" data-image-src="/confluence/download/attachments/24188263/app-error-2.png?version=1&amp;modificationDate=1291068475000&amp;api=v2"></p><p>This is part of Tapestry's way: it not only spells out exactly what it was doing and what went wrong, but it even helps you find a solution; here it tells you the names of properties you could have used.</p><p>Tapestry displays the stack trace of the deepest exception, along with lots of details about the run-time environment: details about the current request, the HttpSession (if one exists), and even a detailed list of all JVM system properties. Scroll down to see all this information.</p>    <di
 v class="aui-message hint shadowed information-macro">
                             <span class="aui-icon icon-hint">Icon</span>
                 <div class="message-content">
-                            
-<p>This level of detail reflects that the application has been configured to run in <em>development mode</em> instead of <em>production mode</em>. In production mode, the exception report would simply be the top level exception message. However, most production applications go further and customize how Tapestry handles and reports exceptions.</p>
+                            <p>This level of detail reflects that the application has been configured to run in <em>development mode</em> instead of <em>production mode</em>. In production mode, the exception report would simply be the top level exception message. However, most production applications go further and customize how Tapestry handles and reports exceptions.</p>
                     </div>
     </div>
-
-
-
-<p>There was a bunch of other stuff on this page, related to links and Ajax and other things, that we'll ignore for the moment.</p>
-
-<hr>
-<p></p><p></p><p><table class="Footnotes" style="width: 100%; border:none;" cellspacing="0" cellpadding="0" summary="This table contains one or more notes for references made elsewhere on the page."><caption class="accessibility">Footnotes</caption><thead class="accessibility"><tr class="accessibility"><th colspan="1" rowspan="1" class="accessibility" id="footnote-th1">Reference</th><th colspan="1" rowspan="1" class="accessibility" id="footnote-th2">Notes</th></tr></thead><tbody><tr name="Footnote1"><td colspan="1" rowspan="1" valign="top" class="FootnoteNum" headings="footnote-th1">
+<p>There was a bunch of other stuff on this page, related to links and Ajax and other things, that we'll ignore for the moment.</p><hr><p>&#160;</p><p><table class="Footnotes" style="width: 100%; border:none;" cellspacing="0" cellpadding="0" summary="This table contains one or more notes for references made elsewhere on the page."><caption class="accessibility">Footnotes</caption><thead class="accessibility"><tr class="accessibility"><th colspan="1" rowspan="1" class="accessibility" id="footnote-th1">Reference</th><th colspan="1" rowspan="1" class="accessibility" id="footnote-th2">Notes</th></tr></thead><tbody><tr name="Footnote1"><td colspan="1" rowspan="1" valign="top" class="FootnoteNum" headings="footnote-th1">
         <a shape="rect" id="FootnoteNum1" href="#FootnoteMarker1" onclick="footnoteMarkerHighlight(&quot;1&quot;);" onmouseover="footnoteHighlight(&quot;1&quot;,false);" alt="Footnote: Click to return to reference in text" title="Footnote: Click to return to reference in text">
             1
         </a>
@@ -640,9 +452,7 @@ greeting=Welcome to Tapestry 5!  We hope
         </a>
       </td><td colspan="1" rowspan="1" valign="top" class="Footnote" id="Footnote6" width="100%" headings="footnote-th2">
           Ok, there's a third way as well, which will be discussed in good time.
-      </td></tr></tbody></table></p><p></p>
-
-<style type="text/css">/*<![CDATA[*/
+      </td></tr></tbody></table></p><style type="text/css">/*<![CDATA[*/
 table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color: #f0f0f0}
 table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
 table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
@@ -650,8 +460,7 @@ table.ScrollbarTable td.ScrollbarParent 
 table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
 table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
 
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="loading-the-project-into-eclipse.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="loading-the-project-into-eclipse.html">Loading the Project Into Eclipse</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo Guessing Game</a></td><td colspa
 n="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="implementing-the-hi-lo-guessing-game.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div>
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td></td></tr></tbody></table></div></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="loading-the-project-into-eclipse.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="loading-the-project-into-eclipse.html">Loading the Project Into Eclipse</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo Guessing Game</a></td><td colspa
 n="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="implementing-the-hi-lo-guessing-game.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/type-coercion.html
==============================================================================
--- websites/production/tapestry/content/type-coercion.html (original)
+++ websites/production/tapestry/content/type-coercion.html Sat Jan 18 17:20:52 2014
@@ -69,9 +69,7 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><h1 id="TypeCoercion-ParameterTypeCoercions">Parameter Type Coercions</h1>
-
-<div class="navmenu" style="float:right; background:white; margin:3px; padding:3px">
+<div id="ConfluenceContent"><h1 id="TypeCoercion-ParameterTypeCoercions">Parameter Type Coercions</h1><div class="navmenu" style="float:right; background:white; margin:3px; padding:3px">
 <div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px"></div>
 <h3>Related Articles</h3>
 <ul class="content-by-label"><li>
@@ -88,7 +86,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="type-coercion.html">Type Coercion</a>
+                            <a shape="rect" href="default-parameter.html">Default Parameter</a>
                     
                 
                             </div>
@@ -97,7 +95,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="component-parameters.html">Component Parameters</a>
+                            <a shape="rect" href="supporting-informal-parameters.html">Supporting Informal Parameters</a>
                     
                 
                             </div>
@@ -106,7 +104,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="default-parameter.html">Default Parameter</a>
+                            <a shape="rect" href="enum-parameter-recipe.html">Enum Parameter Recipe</a>
                     
                 
                             </div>
@@ -115,7 +113,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="supporting-informal-parameters.html">Supporting Informal Parameters</a>
+                            <a shape="rect" href="component-parameters.html">Component Parameters</a>
                     
                 
                             </div>
@@ -124,22 +122,13 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="enum-parameter-recipe.html">Enum Parameter Recipe</a>
+                            <a shape="rect" href="type-coercion.html">Type Coercion</a>
                     
                 
                             </div>
         </li></ul>
-</div> 
-
-<p>Tapestry automatically handles type coercions for <a shape="rect" href="component-parameters.html">component parameters</a>.</p>
-
-<p>Type coercions occur when a value passed into a parameter (as bound in a template or in an annotation) does not match the type of the parameter.</p>
-
-<p>For example, consider the Count component:</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 Count
+</div><p>Tapestry automatically handles type coercions for <a shape="rect" href="component-parameters.html">component parameters</a>.</p><p>Type coercions occur when a value passed into a parameter (as bound in a template or in an annotation) does not match the type of the parameter.</p><p>For example, consider the Count component:</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 Count
 {
     @Parameter
     private int start = 1;
@@ -152,27 +141,10 @@ public class Count
     
     . . .
 ]]></script>
-</div></div>
-
-<p>Here, the type of all three parameters is <code>int</code>.</p>
-
-<p>However, it is likely that the component will be used as so:</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[
-  Merry Christmas: &lt;t:count end=&quot;3&quot;&gt; Ho! &lt;/t:count&gt;
+</div></div><p>Here, the type of all three parameters is <code>int</code>.</p><p>However, it is likely that the component will be used as so:</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[  Merry Christmas: &lt;t:count end=&quot;3&quot;&gt; Ho! &lt;/t:count&gt;
 ]]></script>
-</div></div>
-
-<p>A bare whole number is interpreted by the prop binding prefix as a <code>long</code>. So this is the <em>long</em> value 3.</p>
-
-<p>Tapestry will automatically coerce the bound value, a <code>long</code>, to the parameter's type, <code>int</code>. This may be a lossy coercion (if the <code>long</code> represents a number larger than can be stored in an <code>int</code>).</p>
-
-<h1 id="TypeCoercion-TypeCoercerService">TypeCoercer Service</h1>
-
-<p>Main Article: <a shape="rect" href="typecoercer-service.html">TypeCoercer Service</a></p>
-
-<p>The TypeCoercer service is responsible for this type coercion. This service is part of the <a shape="rect" href="ioc.html">tapestry-ioc</a> module. The service is quite extensible, allowing for new types and coercions to be added easily. The TapestryModule contributes a few additional coercions into the TypeCoercer service.</p></div>
+</div></div><p>A bare whole number is interpreted by the prop binding prefix as a <code>long</code>. So this is the <em>long</em> value 3.</p><p>Tapestry will automatically coerce the bound value, a <code>long</code>, to the parameter's type, <code>int</code>. This may be a lossy coercion (if the <code>long</code> represents a number larger than can be stored in an <code>int</code>).</p><h1 id="TypeCoercion-TypeCoercerService">TypeCoercer Service</h1><p>Main Article: <a shape="rect" href="typecoercer-service.html">TypeCoercer Service</a></p><p>The TypeCoercer service is responsible for this type coercion. This service is part of the <a shape="rect" href="ioc.html">tapestry-ioc</a> module. The service is quite extensible, allowing for new types and coercions to be added easily. The TapestryModule contributes a few additional coercions into the TypeCoercer service.</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/using-tapestry-with-hibernate.html
==============================================================================
--- websites/production/tapestry/content/using-tapestry-with-hibernate.html (original)
+++ websites/production/tapestry/content/using-tapestry-with-hibernate.html Sat Jan 18 17:20:52 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();
@@ -77,25 +78,8 @@ table.ScrollbarTable td.ScrollbarParent 
 table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
 table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
 
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="using-beaneditform-to-create-user-forms.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To Create User Forms</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;</td></tr></table></div>
-
-<p>So, you fill in all the fields, submit the form (without validation errors) and voila: you get back the same form, blanked out. What happened, and where did the data go?</p>
-
-<p>What happened is that we haven't told Tapestry what to do after the form is successfully submitted (by successful, we mean, with no validation errors). Tapestry's default behavior is to redisplay the active page, and that occurs in a new request, with a new instance of the Address object (because the address field is not a peristent field).</p>
-
-<p>Well, since we're creating objects, we might as well store them somewhere ... in a database. We're going to quickly integrate Tapestry with <a shape="rect" class="external-link" href="http://hibernate.org" >Hibernate</a> as the object/relational mapping layer, and ultimately store our data inside a <a shape="rect" class="external-link" href="http://www.hsqldb.org/" >HSQLDB</a> database. HSQLDB is an embedded database engine and requires no installation &#8211; it will be pulled down as a dependency via maven.</p>
-
-<h2 id="UsingTapestryWithHibernate-Re-configuringtheProject">Re-configuring the Project</h2>
-
-<p>We're going to bootstrap this project from a simple Tapestry project to one that uses Hibernate and HSQLDB.</p>
-
-<h3 id="UsingTapestryWithHibernate-UpdatingtheDependencies">Updating the Dependencies</h3>
-
-<p>First, we must update the POM to list a new set of dependencies, that includes Hibernate, the Tapestry/Hibernate integration library, and the HSQLDB JDBC driver:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/pom.xml (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-    &lt;dependencies&gt;
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="using-beaneditform-to-create-user-forms.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To Create User Forms</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="tapestry-tutorial.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;</td></tr></table></div><p>So, you fill in all the fields, submit the form (without validation erro
 rs) and voila: you get back the same form, blanked out. What happened, and where did the data go?</p><p>What happened is that we haven't told Tapestry what to do after the form is successfully submitted (by successful, we mean, with no validation errors). Tapestry's default behavior is to redisplay the active page, and that occurs in a new request, with a new instance of the Address object (because the address field is not a peristent field).</p><p>Well, since we're creating objects, we might as well store them somewhere ... in a database. We're going to quickly integrate Tapestry with <a shape="rect" class="external-link" href="http://hibernate.org" >Hibernate</a> as the object/relational mapping layer, and ultimately store our data inside a <a shape="rect" class="external-link" href="http://www.hsqldb.org/" >HSQLDB</a> database. HSQLDB is an embedded database engine and requires no installation &#8211; it will be pulled down as a dependency via maven.</p><h2 id="UsingTapestryWithH
 ibernate-Re-configuringtheProject">Re-configuring the Project</h2><p>We're going to bootstrap this project from a simple Tapestry project to one that uses Hibernate and HSQLDB.</p><h3 id="UsingTapestryWithHibernate-UpdatingtheDependencies">Updating the Dependencies</h3><p>First, we must update the POM to list a new set of dependencies, that includes Hibernate, the Tapestry/Hibernate integration library, and the HSQLDB JDBC driver:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/pom.xml (partial)</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[    &lt;dependencies&gt;
         &lt;dependency&gt;
             &lt;groupId&gt;org.apache.tapestry&lt;/groupId&gt;
             &lt;artifactId&gt;tapestry-hibernate&lt;/artifactId&gt;
@@ -110,21 +94,8 @@ table.ScrollbarTable td.ScrollbarNextIco
 
     &lt;/dependencies&gt;
 ]]></script>
-</div></div>
-
-<p>The tapestry-hibernate library includes, as transitive dependencies, Hibernate and tapestry-core. This means that you can simply replace "tapestry-core" with "tapestry-hibernate" inside the &lt;artifactId&gt; element.</p>
-
-<p>Since Hibernate can work with so many different databases, we must explicitly add in the correct driver.</p>
-
-<p>After changing the POM, you must re-execute the command <code>mvn eclipse:eclipse -DdownloadSources=true</code>. Then, inside Eclipse, right click on the project (in Package Explorer) and select the "Refresh" menu item. You should also stop Jetty.</p>
-
-<h3 id="UsingTapestryWithHibernate-HibernateConfiguration">Hibernate Configuration</h3>
-
-<p>Hibernate has a master configuration file used to store connection and other data.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/hibernate.cfg.xml</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;!DOCTYPE hibernate-configuration PUBLIC
+</div></div><p>The tapestry-hibernate library includes, as transitive dependencies, Hibernate and tapestry-core. This means that you can simply replace "tapestry-core" with "tapestry-hibernate" inside the &lt;artifactId&gt; element.</p><p>Since Hibernate can work with so many different databases, we must explicitly add in the correct driver.</p><p>After changing the POM, you must re-execute the command <code>mvn eclipse:eclipse -DdownloadSources=true</code>. Then, inside Eclipse, right click on the project (in Package Explorer) and select the "Refresh" menu item. You should also stop Jetty.</p><h3 id="UsingTapestryWithHibernate-HibernateConfiguration">Hibernate Configuration</h3><p>Hibernate has a master configuration file used to store connection and other data.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/hibernate.cfg.xml</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;!DOCTYPE hibernate-configuration PUBLIC
         &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;
         &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
 &lt;hibernate-configuration&gt;
@@ -140,25 +111,8 @@ table.ScrollbarTable td.ScrollbarNextIco
     &lt;/session-factory&gt;
 &lt;/hibernate-configuration&gt;
 ]]></script>
-</div></div>
-
-<p>Most of the configuration is to identify the JDBC driver and connection URL.</p>
-
-<p>Note the connection URL. We are instructing HSQLDB to store its database files within our project's target directory. We are also instructing HSQLDB to flush any data to these files at shutdown. This means that data will persist across different invocations of this project, but if the target directory is destroyed (e.g., via "mvn clean"), then all the database contents will be lost.</p>
-
-<p>In addition, we are configuring Hibernate to <em>update</em> the database schema; when Hibernate initializes it will create or even modify tables to match the entities. Finally, we are configuring Hibernate to output any SQL it executes, which is very useful when initially building an application.</p>
-
-<p>But what entities? Normally, the available entities are listed inside hibernate.cfg.xml, but that's not necessary with Tapestry; in another example of convention over configuration, Tapestry locates all entity classes inside the entities package and adds them to the configuration. Currently, that is just the Address entity.</p>
-
-<h2 id="UsingTapestryWithHibernate-AddingHibernateAnnotations">Adding Hibernate Annotations</h2>
-
-<p>For an entity class to be used with Hibernate, some Hibernate annotations must be added to the class.</p>
-
-<p>Below is the updated Address class, with the Hibernate annotations (as well as the Tapestry ones).</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/entities/Address.java</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-package com.example.tutorial.entities;
+</div></div><p>Most of the configuration is to identify the JDBC driver and connection URL.</p><p>Note the connection URL. We are instructing HSQLDB to store its database files within our project's target directory. We are also instructing HSQLDB to flush any data to these files at shutdown. This means that data will persist across different invocations of this project, but if the target directory is destroyed (e.g., via "mvn clean"), then all the database contents will be lost.</p><p>In addition, we are configuring Hibernate to <em>update</em> the database schema; when Hibernate initializes it will create or even modify tables to match the entities. Finally, we are configuring Hibernate to output any SQL it executes, which is very useful when initially building an application.</p><p>But what entities? Normally, the available entities are listed inside hibernate.cfg.xml, but that's not necessary with Tapestry; in another example of convention over configuration, Tapestry locates all
  entity classes inside the entities package and adds them to the configuration. Currently, that is just the Address entity.</p><h2 id="UsingTapestryWithHibernate-AddingHibernateAnnotations">Adding Hibernate Annotations</h2><p>For an entity class to be used with Hibernate, some Hibernate annotations must be added to the class.</p><p>Below is the updated Address class, with the Hibernate annotations (as well as the Tapestry ones).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/entities/Address.java</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.entities;
 
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
@@ -204,29 +158,8 @@ public class Address
   public String phone;
 }
 ]]></script>
-</div></div>
-
-<p>The Tapestry annotations, @NonVisual and @Validate, may be placed on the setter or getter method or on the field (as we have done here). As with the Hibernate annotations, putting the annotation on the field requires that the field name match the corresponding property name.</p>
-
-<ul><li><strong>@NonVisual</strong> &#8211; indicates a field, such as a primary key, that should not be made visible to the user.</li><li><strong>@Validate</strong> &#8211; identifies the validations associated with a field.</li></ul>
-
-
-<h2 id="UsingTapestryWithHibernate-UpdatingtheDatabase">Updating the Database</h2>
-
-<p>So we have a database up and running, and Hibernate is configured to connect to it. Let's make use of that to store our Address object in the database.</p>
-
-<p>What we need is to provide some code to be executed when the form is submitted. When a Tapestry form is submitted, there is a whole series of events that get fired. The event we are interested in is the "success" event, which comes late in the process, after all the values have been pulled out of the request and applied to the page properties, and after all server-side validations have occured.</p>
-
-<p>The success event is only fired if there are no validation errors.</p>
-
-<p>Our event handler must do two things:</p>
-
-<ul><li>Use the Hibernate Session object to persist the new Address object.</li><li>Commit the transaction to force the data to be written to the database.</li></ul>
-
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/address/CreateAddress.java</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-package com.example.tutorial.pages.address;
+</div></div><p>The Tapestry annotations, @NonVisual and @Validate, may be placed on the setter or getter method or on the field (as we have done here). As with the Hibernate annotations, putting the annotation on the field requires that the field name match the corresponding property name.</p><ul><li><strong>@NonVisual</strong> &#8211; indicates a field, such as a primary key, that should not be made visible to the user.</li><li><strong>@Validate</strong> &#8211; identifies the validations associated with a field.</li></ul><h2 id="UsingTapestryWithHibernate-UpdatingtheDatabase">Updating the Database</h2><p>So we have a database up and running, and Hibernate is configured to connect to it. Let's make use of that to store our Address object in the database.</p><p>What we need is to provide some code to be executed when the form is submitted. When a Tapestry form is submitted, there is a whole series of events that get fired. The event we are interested in is the "success" event, which
  comes late in the process, after all the values have been pulled out of the request and applied to the page properties, and after all server-side validations have occured.</p><p>The success event is only fired if there are no validation errors.</p><p>Our event handler must do two things:</p><ul><li>Use the Hibernate Session object to persist the new Address object.</li><li>Commit the transaction to force the data to be written to the database.</li></ul><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/address/CreateAddress.java</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages.address;
 
 import com.example.tutorial.entities.Address;
 import com.example.tutorial.pages.Index;
@@ -256,43 +189,11 @@ public class CreateAddress
     }
 }
 ]]></script>
-</div></div>
-
-<p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> annotation tells Tapestry to inject a service into the annotated field; Tapestry includes a sophisticated Inversion of Control container (similar in many ways to Spring) that is very good at locating available services by type, rather than by a string id. In any case, the Hibernate Session object is exposed as a Tapestry IoC service, ready to be injected (this is one of the things provided by the tapestry-hibernate module).</p>
-
-<p>Tapestry automatically starts a transaction as necessary; however that transaction will be <em>aborted</em> at the end of the request. If we make changes to persistent objects, such as adding a new Address object, then it is necessary to commit the transaction.</p>
-
-<p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/hibernate/annotations/CommitAfter.html">CommitAfter</a> annotation can be applied to any component method; if the method completes normally, the transaction will be committed (and a new transaction started to replace the committed transaction).</p>
-
-<p>After persisting the new address, we return to the main Index page of the application.</p>
-
-<p><em>Note: In real applications, it is rare to have pages and components directly use the Hibernate Session. It is generally a better approach to define your own Data Access Object layer to perform common update operations and queries.</em></p>
-
-<h2 id="UsingTapestryWithHibernate-ShowingAddresses">Showing Addresses</h2>
-
-<p>As a little preview of what's next, let's display all the Addresses entered by the user on the Index page of the application. After you enter a few names, it will look something like:</p>
-
-<p><img class="confluence-embedded-image confluence-content-image-border" src="https://cwiki.apache.org/confluence/download/attachments/23340507/index-grid-v1.png?version=1&amp;modificationDate=1286814603000&amp;api=v2" data-image-src="/confluence/download/attachments/23340507/index-grid-v1.png?version=1&amp;modificationDate=1286814603000&amp;api=v2"></p>
-
-<h2 id="UsingTapestryWithHibernate-AddingtheGridtotheIndexpage">Adding the Grid to the Index page</h2>
-
-<p>So, how is this implemented? Primarily, its accomplished by the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html">Grid</a> component.</p>
-
-<p>The Grid component is based on the same concepts as the BeanEditForm component; it can pull apart a bean into columns. The columns are sortable, and when there are more entries than will fit on a single page, page navigation is automatically added.</p>
-
-<p>A minimal Grid is very easy to add to the template:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/webapp/Index.tml (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-  &lt;t:grid source=&quot;addresses&quot;/&gt;
+</div></div><p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> annotation tells Tapestry to inject a service into the annotated field; Tapestry includes a sophisticated Inversion of Control container (similar in many ways to Spring) that is very good at locating available services by type, rather than by a string id. In any case, the Hibernate Session object is exposed as a Tapestry IoC service, ready to be injected (this is one of the things provided by the tapestry-hibernate module).</p><p>Tapestry automatically starts a transaction as necessary; however that transaction will be <em>aborted</em> at the end of the request. If we make changes to persistent objects, such as adding a new Address object, then it is necessary to commit the transaction.</p><p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/hibernate/annota
 tions/CommitAfter.html">CommitAfter</a> annotation can be applied to any component method; if the method completes normally, the transaction will be committed (and a new transaction started to replace the committed transaction).</p><p>After persisting the new address, we return to the main Index page of the application.</p><p><em>Note: In real applications, it is rare to have pages and components directly use the Hibernate Session. It is generally a better approach to define your own Data Access Object layer to perform common update operations and queries.</em></p><h2 id="UsingTapestryWithHibernate-ShowingAddresses">Showing Addresses</h2><p>As a little preview of what's next, let's display all the Addresses entered by the user on the Index page of the application. After you enter a few names, it will look something like:</p><p><img class="confluence-embedded-image confluence-content-image-border" src="https://cwiki.apache.org/confluence/download/attachments/23340507/index-grid-v1.pn
 g?version=1&amp;modificationDate=1286814603000&amp;api=v2" data-image-src="/confluence/download/attachments/23340507/index-grid-v1.png?version=1&amp;modificationDate=1286814603000&amp;api=v2"></p><h2 id="UsingTapestryWithHibernate-AddingtheGridtotheIndexpage">Adding the Grid to the Index page</h2><p>So, how is this implemented? Primarily, its accomplished by the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html">Grid</a> component.</p><p>The Grid component is based on the same concepts as the BeanEditForm component; it can pull apart a bean into columns. The columns are sortable, and when there are more entries than will fit on a single page, page navigation is automatically added.</p><p>A minimal Grid is very easy to add to the template:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/webapp/Index.tml 
 (partial)</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;t:grid source=&quot;addresses&quot;/&gt;
 ]]></script>
-</div></div>
-
-<p>And all we have to do is supply the addresses property in the Java code:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/Index.java (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-    @Inject
+</div></div><p>And all we have to do is supply the addresses property in the Java code:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>src/main/java/com/example/tutorial/pages/Index.java (partial)</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[    @Inject
     private Session session;
 
     public List&lt;Address&gt; getAddresses()
@@ -300,17 +201,7 @@ public class CreateAddress
         return session.createCriteria(Address.class).list();
     }
 ]]></script>
-</div></div>
-
-<p>Here, we're using the Hibernate Session object to find all Address objects in the database. Any sorting that takes place will be done in memory. This is fine for now (with only a handful of Address objects in the database). Later we'll see how to optimize this for very large result sets.</p>
-
-<h2 id="UsingTapestryWithHibernate-What'sNext?">What's Next?</h2>
-
-<p>We have lots more to talk about: more components, more customizations, built-in Ajax support, more common design and implementation patterns, and even writing your own components (which is easy!).</p>
-
-<p>Check out the many Tapestry resources available on the <a shape="rect" href="documentation.html">Tapestry 5 Documentation page</a> page, including the <a shape="rect" href="getting-started.html">Getting Started</a> and <a shape="rect" href="frequently-asked-questions.html">FAQ</a> pages and the <a shape="rect" href="cookbook.html">Cookbook Recipies</a>. Be sure to peruse the <a shape="rect" href="user-guide.html">User Guide</a>, which provides comprehensive details on nearly every Tapestry topic.</p>
-
-<style type="text/css">/*<![CDATA[*/
+</div></div><p>Here, we're using the Hibernate Session object to find all Address objects in the database. Any sorting that takes place will be done in memory. This is fine for now (with only a handful of Address objects in the database). Later we'll see how to optimize this for very large result sets.</p><h2 id="UsingTapestryWithHibernate-What'sNext?">What's Next?</h2><p>We have lots more to talk about: more components, more customizations, built-in Ajax support, more common design and implementation patterns, and even writing your own components (which is easy!).</p><p>Check out the many Tapestry resources available on the <a shape="rect" href="documentation.html">Tapestry 5 Documentation page</a> page, including the <a shape="rect" href="getting-started.html">Getting Started</a> and <a shape="rect" href="frequently-asked-questions.html">FAQ</a> pages and the <a shape="rect" href="cookbook.html">Cookbook Recipies</a>. Be sure to peruse the <a shape="rect" href="user-guide.html">Us
 er Guide</a>, which provides comprehensive details on nearly every Tapestry topic.</p><style type="text/css">/*<![CDATA[*/
 table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color: #f0f0f0}
 table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
 table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}