tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r959694 [5/5] - in /websites/production/tapestry/content: ./ cache/
Date Sun, 26 Jul 2015 23:19:57 GMT
Modified: websites/production/tapestry/content/specific-errors-faq.html
==============================================================================
--- websites/production/tapestry/content/specific-errors-faq.html (original)
+++ websites/production/tapestry/content/specific-errors-faq.html Sun Jul 26 23:19:56 2015
@@ -67,7 +67,46 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><h2 id="SpecificErrorsFAQ-SpecificErrors">Specific Errors</h2><h3 id="SpecificErrorsFAQ-WhydoIgettheexception&quot;Noserviceimplementstheinterfaceorg.apache.tapestry5.internal.InternalComponentResources&quot;whentryingtousetheBeanEditFormcomponent?">Why do I get the exception "No service implements the interface org.apache.tapestry5.internal.InternalComponentResources" when trying to use the BeanEditForm component?</h3><p>This can occur when you choose the wrong package for your data object, the object edited by the BeanEditForm component. If you place it in the same package as your pages, Tapestry will treat it like a page, and perform a number of transformation on it, including adding a new constructor.</p><p>Only component classes should go in the Tapestry-controlled packages (<code>pages</code>, <code>components</code>, <code>mixins</code> and <code>base</code> under your application's root package). By convention, simple data objects should go in a <
 code>data</code> package, and Hibernate entities should go in an <code>entities</code> package.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This is likely a bit different in 5.3 than in 5.2 (because 5.3 builds a very different constructor into the component) and needs to be tested in 5.3 to see what exact exception will occur.</p></div></div><h3 id="SpecificErrorsFAQ-Igetanerrorabout&quot;Pagedidnotgenerateanymarkupwhenrendered.&quot;butIhaveatemplate,whathappened?">I get an error about "Page did not generate any markup when rendered." but I have a template, what happened?</h3><p>The most common error here is that the case of the page class did not match the case of the template. For example, you might name your class ViewOrders, but name the template vieworders.tml. The correct name for the template 
 is ViewOrders.tml, matching the case of the Java class name.</p><p>Worse, you may find that your application works during development (under Windows, which is case insensitive) but does not work when deployed on a Linux or Unix server, which may be case sensitive.</p><p>The other cause of this may be that your template files simply are not being packaged up correctly with the rest of your application. When in doubt, use the Java <code>jar</code> command to see exactly whats inside your WAR file. Your page templates should either be in the root folder of the WAR, or package with the corresponding .class file.</p><h3 id="SpecificErrorsFAQ-MyapplicationfailswiththeerrorPermGen,howdoIfixthis?">My application fails with the error <strong>PermGen</strong>, how do I fix this?</h3><p>PermGen refers to the part of the Java memory space devoted to permanent objects, which are mostly loaded classes. When developing under Tapestry, many more classes and class loaders are created than normal; th
 is is part of live class reloading. Because of this, you will want to increase the amount of memory Java devotes to this.</p><p>The solution is to add <code>-XX:MaxPermSize=512m</code> to your command line. You may also want to increase the regular amount of heap space with <code>-Xmx600M</code>. Of course, you may need to adjust the amount of memory in each category to match your actual application, but these are good starting values.</p><p>Java Virtual Machine arguments can be specified inside an Eclipse launch configuration:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail" src="specific-errors-faq.data/eclipse-permgen.png"></span></p><h3 id="SpecificErrorsFAQ-WhydoIsometimesgetajava.lang.NoSuchMethodErrorexceptionafterreloadingmypage?">Why do I sometimes get a <code>java.lang.NoSuchMethodError</code> exception after reloading my page?</h3><p>Tapestry's live class reloading is not perfect.&#160;<span style="line-heigh
 t: 1.4285715;">It tends to use a lot of Java ClassLoaders on top of the normal ClassLoaders used by the Java Virtual Machine and the servlet container. When you change non-component classes and interfaces that are referenced by components and pages, such as to add or change a method, only the component classes are reloaded. The non-component classes are frozen as they were when they were </span><em style="line-height: 1.4285715;">first</em><span style="line-height: 1.4285715;"> loaded.</span></p><p>Unfortunately, this is one of the areas where you must restart your application entirely in order to force the new versions of the non-component classes to be loaded into memory.</p><p>&#160;</p></div>
+<div id="ConfluenceContent"><div class="aui-label" style="float:right" title="Related Articles">
+
+
+
+
+
+
+
+
+<h3>Related Articles</h3>
+
+<ul class="content-by-label"><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="error-page-recipe.html">Error Page Recipe</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="specific-errors-faq.html">Specific Errors FAQ</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="overriding-exception-reporting.html">Overriding Exception Reporting</a>
+                
+                        
+                    </div>
+    </li></ul>
+</div><h3 id="SpecificErrorsFAQ-WhydoIgettheexception&quot;Noserviceimplementstheinterfaceorg.apache.tapestry5.internal.InternalComponentResources&quot;whentryingtousetheBeanEditFormcomponent?">Why do I get the exception "No service implements the interface org.apache.tapestry5.internal.InternalComponentResources" when trying to use the BeanEditForm component?</h3><p>This can occur when you choose the wrong package for your data object, the object edited by the BeanEditForm component. If you place it in the same package as your pages, Tapestry will treat it like a page, and perform a number of transformation on it, including adding a new constructor.</p><p>Only component classes should go in the Tapestry-controlled packages (<code>pages</code>, <code>components</code>, <code>mixins</code> and <code>base</code> under your application's root package). By convention, simple data objects should go in a <code>data</code> package, and Hibernate entities should go in an <code>entities</cod
 e> package.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This is likely a bit different in 5.3 than in 5.2 (because 5.3 builds a very different constructor into the component) and needs to be tested in 5.3 to see what exact exception will occur.</p></div></div><h3 id="SpecificErrorsFAQ-Igetanerrorabout&quot;Pagedidnotgenerateanymarkupwhenrendered.&quot;butIhaveatemplate,whathappened?">I get an error about "Page did not generate any markup when rendered." but I have a template, what happened?</h3><p>The most common error here is that the case of the page class did not match the case of the template. For example, you might name your class ViewOrders, but name the template vieworders.tml. The correct name for the template is ViewOrders.tml, matching the case of the Java class name.</p><p>Worse, you may fi
 nd that your application works during development (under Windows, which is case insensitive) but does not work when deployed on a Linux or Unix server, which may be case sensitive.</p><p>The other cause of this may be that your template files simply are not being packaged up correctly with the rest of your application. When in doubt, use the Java <code>jar</code> command to see exactly whats inside your WAR file. Your page templates should either be in the root folder of the WAR, or package with the corresponding .class file.</p><h3 id="SpecificErrorsFAQ-MyapplicationfailswiththeerrorPermGen,howdoIfixthis?">My application fails with the error <strong>PermGen</strong>, how do I fix this?</h3><p>PermGen refers to the part of the Java memory space devoted to permanent objects, which are mostly loaded classes. When developing under Tapestry, many more classes and class loaders are created than normal; this is part of live class reloading. Because of this, you will want to increase the a
 mount of memory Java devotes to this.</p><p>The solution is to add <code>-XX:MaxPermSize=512m</code> to your command line. You may also want to increase the regular amount of heap space with <code>-Xmx600M</code>. Of course, you may need to adjust the amount of memory in each category to match your actual application, but these are good starting values.</p><p>Java Virtual Machine arguments can be specified inside an Eclipse launch configuration:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail" src="specific-errors-faq.data/eclipse-permgen.png"></span></p><h3 id="SpecificErrorsFAQ-WhydoIsometimesgetajava.lang.NoSuchMethodErrorexceptionafterreloadingmypage?">Why do I sometimes get a <code>java.lang.NoSuchMethodError</code> exception after reloading my page?</h3><p>Tapestry's live class reloading is not perfect.&#160;<span style="line-height: 1.4285715;">It tends to use a lot of Java ClassLoaders on top of the normal Class
 Loaders used by the Java Virtual Machine and the servlet container. When you change non-component classes and interfaces that are referenced by components and pages, such as to add or change a method, only the component classes are reloaded. The non-component classes are frozen as they were when they were </span><em style="line-height: 1.4285715;">first</em><span style="line-height: 1.4285715;"> loaded.</span></p><p>Unfortunately, this is one of the areas where you must restart your application entirely in order to force the new versions of the non-component classes to be loaded into memory.</p><p>&#160;</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/supporting-informal-parameters.html
==============================================================================
--- websites/production/tapestry/content/supporting-informal-parameters.html (original)
+++ websites/production/tapestry/content/supporting-informal-parameters.html Sun Jul 26 23:19:56 2015
@@ -67,27 +67,56 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent">
-<p></p>
+<div id="ConfluenceContent"><p><strong>Informal parameters</strong> are any additional parameters beyond the parameters explicitly defined for a component using the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/Parameter.html">Parameter</a> annotation.</p><div class="aui-label" style="float:right" title="Related Articles">
 
-<h2 id="SupportingInformalParameters-SupportingInformalParameters">Supporting Informal Parameters</h2>
 
-<div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div>
 
-<p>Informal parameters are any additional parameters beyond the parameters explicitly defined for a component using the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/Parameter.html">Parameter</a> annotation.</p>
 
-<p>Any component that closely emulates a particular HTML element <em>should</em> support informal parameters. You'll find that many of the built-in Tapestry components, such as Form, Label and TextField, do exactly that.</p>
 
-<p>To support informal parameters, a component class should use either the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html">SupportsInformalParameters</a> annotation or the RenderInformals mixin. Otherwise, providing informal parameters to a component will do nothing: any additional parameters will be ignored.</p>
 
-<h3 id="SupportingInformalParameters-Approach1:@SupportsInformalParameters">Approach 1: @SupportsInformalParameters</h3>
 
-<p>In the example below we create an Img component, a custom replacement for the &lt;img&gt; tag. Its src parameter will be an asset. We'll use the @SupportsInformalParameters annotation to tell Tapestry that the component should support informal parameters.</p>
 
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
-@SupportsInformalParameters
+<h3>Related Articles</h3>
+
+<ul class="content-by-label"><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="enum-parameter-recipe.html">Enum Parameter Recipe</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="supporting-informal-parameters.html">Supporting Informal Parameters</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="default-parameter.html">Default Parameter</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="component-parameters.html">Component Parameters</a>
+                
+                        
+                    </div>
+    </li></ul>
+</div><p>Any component that closely emulates a particular HTML element <em>should</em> support informal parameters. You'll find that many of the built-in Tapestry components, such as Form, Label and TextField, do exactly that.</p><p>To support informal parameters, a component class should use either the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html">SupportsInformalParameters</a> annotation or the RenderInformals mixin. Otherwise, providing informal parameters to a component will do nothing: any additional parameters will be ignored.</p><h3 id="SupportingInformalParameters-Approach1:@SupportsInformalParameters">Approach 1: @SupportsInformalParameters</h3><p>In the example below we create an Img component, a custom replacement for the &lt;img&gt; tag. Its src parameter will be an asset. We'll use the @SupportsInformalParameters annotation to tell Tapestry that the component sh
 ould support informal parameters.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@SupportsInformalParameters
 public class Img
 {
     @Parameter(required=true, allowNull=false, defaultPrefix=BindingConstants.ASSET)
@@ -105,19 +134,8 @@ public class Img
     }
 }
 </pre>
-</div></div>
-
-<p>The call to renderInformalParameters() is what converts and outputs the informal parameters. It should occur <em>after</em> your code has rendered attributes into the element (earlier written attributes will <em>not</em> be overwritten by later written attributes).</p>
-
-<p>Returning false from beginRender() ensures that the body of the component is not rendered, which makes sense for an &lt;img&gt; tag, which has no body.</p>
-
-<h3 id="SupportingInformalParameters-Approach2:RenderInformals">Approach 2: RenderInformals</h3>
-
-<p>Another, equivalent, approach is to use the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/corelib/mixins/RenderInformals.html">RenderInformals</a> mixin:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
-public class Img
+</div></div><p>The call to renderInformalParameters() is what converts and outputs the informal parameters. It should occur <em>after</em> your code has rendered attributes into the element (earlier written attributes will <em>not</em> be overwritten by later written attributes).</p><p>Returning false from beginRender() ensures that the body of the component is not rendered, which makes sense for an &lt;img&gt; tag, which has no body.</p><h3 id="SupportingInformalParameters-Approach2:RenderInformals">Approach 2: RenderInformals</h3><p>Another, equivalent, approach is to use the <a shape="rect" class="external-link" href="http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/corelib/mixins/RenderInformals.html">RenderInformals</a> mixin:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">public class Img
 {
     @Parameter(required=true, allowNull=false, defaultPrefix=BindingConstants.ASSET)
     private Asset src;
@@ -137,9 +155,7 @@ public class Img
     }
 }
 </pre>
-</div></div>
-
-<p>This variation splits the rendering of the tag in two pieces, so that the RenderInformals mixin can operate (after beginRender() and before beforeRenderBody()).</p></div>
+</div></div><p>This variation splits the rendering of the tag in two pieces, so that the RenderInformals mixin can operate (after beginRender() and before beforeRenderBody()).</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/tapestry-for-jsf-users.html
==============================================================================
--- websites/production/tapestry/content/tapestry-for-jsf-users.html (original)
+++ websites/production/tapestry/content/tapestry-for-jsf-users.html Sun Jul 26 23:19:56 2015
@@ -67,8 +67,64 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><h1 id="TapestryforJSFUsers-TapestryforJSFUsers">Tapestry for JSF Users</h1><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div><p>This isa brief guide for learning Tapestry, designed for those who already know JavaServer Faces (JSF).</p><p>Because both JSF and Tapestry are component oriented frameworks designed to serve mostly the same kinds of problems in similar ways, developers who already know JSF will find it very easy to learn Tapestry. In fact, Facelets, the default view technology in JSF 2.0, was created specifically to give JSF a Tapestry-like templating capability, so Facelets users should feel right at home.</p><p>Since almost all modern JSF applications use Facelets as their view technology, we assume the use of Facelets here when discussing JSF features.</p><p>JSF is a rich, mature web framework specification, and there are lots of smart people who use it productively. This guide isn't intended as a pro-
 versus-con comparison or as advocacy of any kind. Instead, it just attempts to make transitions between the two frameworks easier, regardless of the reason for doing so.</p><h2 id="TapestryforJSFUsers-Side-by-sideComparison">Side-by-side Comparison</h2><p>JSF and Tapestry have a lot of superficial similarities, so the first steps in that transition are all about relating similar concepts, terms and components in your mind:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Concepts &amp; Terminology</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Java class associated with a page or component</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"Backing Bean"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"<a shape="rect" href="component-class
 es.html">Component Class</a>"</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Component attributes/parameters</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"attributes"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"<a shape="rect" href="component-parameters.html">parameters</a>"</p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Common Attributes/Parameters</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>HTML Attribute used for invisible instrumentation</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>jsfc="someComponentType"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" href="component-templates.html">t:type="someComponentType"</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>CSS "class" attribute na
 me</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>styleClass</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>class</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Alternating "zebra" striped rows</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>rowclasses="class1,class2"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>class="${cycle:class1,class2}" using <a shape="rect" class="external-link" href="https://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefixCycle">cycle binding prefix</a>, or with CSS: .rowClass:nth-child(even) {background-color: #e8e8e8;}</p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Output and Messages</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Escaped HTML from property</p></td><td colspan="1" rowspan="1" class="co
 nfluenceTd"><p>&lt;h:outputText value="myBean.myValue"/&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>${myValue}</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Raw HTML from property</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>#{myBean.myValue}</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/OutputRaw.html">&lt;t:outputRaw value="myValue"/&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Error messages</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:message&gt; and &lt;h:messages&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html">&lt;t:error&gt;</a> and <a shape="rect" class="external-link" href="
 http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Errors.html">&lt;t:errors&gt;</a> (for forms) or <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Alerts.html">&lt;t:alerts&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Image display</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:graphicImage&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>use standard &lt;img&gt; tag</em></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Conditionals and Looping</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Render-time loop</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;ui:repeat&gt;</p></td><td colspan="1" rowspan="1" class="conflu
 enceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Loop.html">&lt;t:loop&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Compile-time loop</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;c:forEach&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Loop.html">&lt;t:loop&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Conditional</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;c:if test="#{myBean.myValue}"&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/If.html">&lt;t:if test="myValue"&gt;</a></p></td></tr><tr><td colspan="1" rowspan
 ="1" class="confluenceTd"><p>Conditional</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;ui:fragment rendered="#{myBean.someCondition}"/&gt;...&lt;/ui:fragment&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/If.html">&lt;t:if test="someCondition"&gt;...&lt;/t:if&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Switch</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;c:choose&gt;&lt;c:when ... &gt;&lt;/c:choose&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>See <a shape="rect" href="switching-cases.html">Switching Cases</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Server-side comment</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;ui:remove&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" href="c
 omponent-templates.html">&lt;t:remove&gt;</a></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Links and Buttons</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Navigational link</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:link outcome="nextpage.xhtml"/&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/PageLink.html">&lt;t:pagelink page="nextpage"/&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Event-triggering link, without form submission</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>not available</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href
 ="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/ActionLink.html">&lt;t:actionLink&gt;</a> or <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/EventLink.html">&lt;t:eventLink&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Form submission link</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:commandLink&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/LinkSubmit.html">&lt;t:linkSubmit&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Form submission button</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:commandButton&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apa
 che.org/current/apidocs/org/apache/tapestry5/corelib/components/Submit.html">&lt;t:submit&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Link to Javascript file</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputScript&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>&lt;script&gt; or use @Import in component class</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Link to CSS file</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputStylesheet&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>&lt;style&gt; or use @Import in component class</em></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Grids, Tables and Trees</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Tabular data in &lt;
 table&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:datatable&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html">&lt;t:grid&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Table used for layout</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:panelGrid&gt; with &lt;h:panelGroup&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>use standard &lt;table&gt; tag</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Hierarchical tree</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>depends on component library</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Tree.html">&lt;t:tree
 &gt;</a></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Form Tags/Components</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Form</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:form&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Form.html">&lt;t:form&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Single-line text input field</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputText&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html">&lt;t:textField&gt
 ;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Password field</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputSecret&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/PasswordField.html">&lt;t:passwordfield&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Select menu</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectOneMenu&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html">&lt;t:select&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Checkbox</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectBooleanCheckbox&gt;</p></td><td colspan="1" rowspan="1
 " class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checkbox.html">&lt;t:checkbox&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Checkbox list</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectManyCheckbox&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checklist.html">&lt;t:checklist&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Radio button list</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectOneRadio&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/RadioGroup.html">&lt;t:radioGroup&gt;</a> with <
 a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Radio.html">&lt;t:radio&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Multiple select menu</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectManyListbox&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>not available</em> (but see Palette and Checklist)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Hidden field</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputHidden&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Hidden.html">&lt;t:hidden&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>textarea tag</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputTextarea
 &gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextArea.html">&lt;t:textArea&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Label tag</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputLabel for="..."&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Label.html">&lt;t:label for="..."&gt;</a></p></td></tr></tbody></table></div><p>Some important notes:</p><ul><li>With Tapestry, you don't use the ${...} syntax with parameters of components. Just use a bare expression within the quotes. For example: &lt;t:textfield value="myProperty"&gt; instead of &lt;t:textfield value="${myProperty}"&gt;, because in the latter case the expression is converted to a read-o
 nly string before the textfield component gets it.</li></ul><h2 id="TapestryforJSFUsers-HelloWorldComparison">Hello World Comparison</h2><p>Faces templates and Tapestry templates are superficially quite similar.</p><div class="sectionColumnWrapper"><div class="sectionMacro"><div class="sectionMacroRow"><div class="columnMacro"><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>JSF template (helloworld.xhtml)</b></div><div class="codeContent panelContent pdl">
+<div id="ConfluenceContent"><p>This is&#160;a brief guide for learning Tapestry, designed for those who already know JavaServer Faces (JSF).</p><p>Because both JSF and Tapestry are component oriented frameworks designed to serve mostly the same kinds of problems in similar ways, developers who already know JSF will find it very easy to learn Tapestry. In fact, Facelets, the default view technology in JSF 2.0, was created specifically to give JSF a Tapestry-like templating capability, so Facelets users should feel right at home.</p><div class="aui-label" style="float:right" title="Related Articles">
+
+
+
+
+
+
+
+
+<h3>Related Articles</h3>
+
+<ul class="content-by-label"><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="tapestry-for-jsf-users.html">Tapestry for JSF Users</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="tapestry-tutorial.html">Tapestry Tutorial</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="principles.html">Principles</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="getting-started.html">Getting Started</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="introduction.html">Introduction</a>
+                
+                        
+                    </div>
+    </li></ul>
+</div><p>Since almost all modern JSF applications use Facelets as their view technology, we assume the use of Facelets here when discussing JSF features.</p><p>JSF is a rich, mature web framework specification, and there are lots of smart people who use it productively. This guide isn't intended as a pro-versus-con comparison or as advocacy of any kind. Instead, it just attempts to make transitions between the two frameworks easier, regardless of the reason for doing so.</p><h2 id="TapestryforJSFUsers-Side-by-sideComparison">Side-by-side Comparison</h2><p>JSF and Tapestry have a lot of superficial similarities, so the first steps in that transition are all about relating similar concepts, terms and components in your mind:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Concepts &amp; Terminology</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenc
 eTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Java class associated with a page or component</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"Backing Bean"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"<a shape="rect" href="component-classes.html">Component Class</a>"</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Component attributes/parameters</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"attributes"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>"<a shape="rect" href="component-parameters.html">parameters</a>"</p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Common Attributes/Parameters</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>HTML Attribute used for invisible instrumentation</p></td><td
  colspan="1" rowspan="1" class="confluenceTd"><p>jsfc="someComponentType"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" href="component-templates.html">t:type="someComponentType"</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>CSS "class" attribute name</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>styleClass</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>class</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Alternating "zebra" striped rows</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>rowclasses="class1,class2"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>class="${cycle:class1,class2}" using <a shape="rect" class="external-link" href="https://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefixCycle">cycle binding prefix</a>, or with CSS: .rowClass:nth-child(even) {background-color: #e8e8e8;}</p></td></tr><tr><th colspan="1" rowspan="1" class="confl
 uenceTh"><p>Output and Messages</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Escaped HTML from property</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputText value="myBean.myValue"/&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>${myValue}</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Raw HTML from property</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>#{myBean.myValue}</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/OutputRaw.html">&lt;t:outputRaw value="myValue"/&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Error messages</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&l
 t;h:message&gt; and &lt;h:messages&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html">&lt;t:error&gt;</a> and <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Errors.html">&lt;t:errors&gt;</a> (for forms) or <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Alerts.html">&lt;t:alerts&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Image display</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:graphicImage&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>use standard &lt;img&gt; tag</em></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Conditionals and Looping</p></th><th colspan="1" rowspan="1" clas
 s="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Render-time loop</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;ui:repeat&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Loop.html">&lt;t:loop&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Compile-time loop</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;c:forEach&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Loop.html">&lt;t:loop&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Conditional</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
 &lt;c:if test="#{myBean.myValue}"&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/If.html">&lt;t:if test="myValue"&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Conditional</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;ui:fragment rendered="#{myBean.someCondition}"/&gt;...&lt;/ui:fragment&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/If.html">&lt;t:if test="someCondition"&gt;...&lt;/t:if&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Switch</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;c:choose&gt;&lt;c:when ... &gt;&lt;/c:choose&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>See <a shape
 ="rect" href="switching-cases.html">Switching Cases</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Server-side comment</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;ui:remove&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" href="component-templates.html">&lt;t:remove&gt;</a></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Links and Buttons</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Navigational link</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:link outcome="nextpage.xhtml"/&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/PageLink.html">&lt;t:pagelink page="nextpage"/&gt;
 </a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Event-triggering link, without form submission</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>not available</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/ActionLink.html">&lt;t:actionLink&gt;</a> or <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/EventLink.html">&lt;t:eventLink&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Form submission link</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:commandLink&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/LinkSubmit.html">&lt;t:linkSubmit&g
 t;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Form submission button</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:commandButton&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Submit.html">&lt;t:submit&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Link to Javascript file</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputScript&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>&lt;script&gt; or use @Import in component class</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Link to CSS file</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputStylesheet&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>&lt;style&gt; or use @Import in component class</em></p></td><
 /tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Grids, Tables and Trees</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Tabular data in &lt;table&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:datatable&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html">&lt;t:grid&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Table used for layout</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:panelGrid&gt; with &lt;h:panelGroup&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>use standard &lt;table&gt; tag</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Hierarchical tree<
 /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>depends on component library</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Tree.html">&lt;t:tree&gt;</a></p></td></tr><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Form Tags/Components</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>JSF</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Form</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:form&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Form.html">&lt;t:form&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Single-line text input f
 ield</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputText&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html">&lt;t:textField&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Password field</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputSecret&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/PasswordField.html">&lt;t:passwordfield&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Select menu</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectOneMenu&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry
 .apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html">&lt;t:select&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Checkbox</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectBooleanCheckbox&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checkbox.html">&lt;t:checkbox&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Checkbox list</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectManyCheckbox&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checklist.html">&lt;t:checklist&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Radio button list</p></td><td co
 lspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectOneRadio&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/RadioGroup.html">&lt;t:radioGroup&gt;</a> with <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Radio.html">&lt;t:radio&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Multiple select menu</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:selectManyListbox&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>not available</em> (but see Palette and Checklist)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Hidden field</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputHidden&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" 
 class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Hidden.html">&lt;t:hidden&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>textarea tag</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:inputTextarea&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextArea.html">&lt;t:textArea&gt;</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Label tag</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&lt;h:outputLabel for="..."&gt;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Label.html">&lt;t:label for="..."&gt;</a></p></td></tr></tbody></table></div><p>Some important notes:</
 p><ul><li>With Tapestry, you don't use the ${...} syntax with parameters of components. Just use a bare expression within the quotes. For example: &lt;t:textfield value="myProperty"&gt; instead of &lt;t:textfield value="${myProperty}"&gt;, because in the latter case the expression is converted to a read-only string before the textfield component gets it.</li></ul><h2 id="TapestryforJSFUsers-HelloWorldComparison">Hello World Comparison</h2><p>Faces templates and Tapestry templates are superficially quite similar.</p><div class="sectionColumnWrapper"><div class="sectionMacro"><div class="sectionMacroRow"><div class="columnMacro"><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>JSF template (helloworld.xhtml)</b></div><div class="codeContent panelContent pdl">
 <pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:h="http://java.sun.com/jsf/html"&gt;
   &lt;h:body&gt;
@@ -105,7 +161,7 @@ public class HelloWorldBean {
     private String lastName;
     @NotNull @Email private String email;
 </pre>
-</div></div><h3 id="TapestryforJSFUsers-Post-Redirect-GetNavigation">Post-Redirect-Get Navigation</h3><p>By default, most JSF URLs are "one page behind". That is, when you click on an &lt;h:commandLink&gt; link or submit a form, the request goes back to the originating page, and the server returns the contents of the <strong>next</strong> page &#8211; but the URL in the browser shows the previous page's URL. To fix this in JSF you add the "?faces-redirect=true" to the URL you return from event handlers, which causes JSF to send a redirect to the browser to navigate to the next page.</p><p>By contrast, Tapestry implements this Post-Redirect-Get pattern by default. The URL will always reflect the page you're seeing, not the page you just came from.</p><p>Note that by default Tapestry does not save property values across the Post-Redirect-Get cycle. This means that you have to consider how (and whether) to persist property values from one page to the next. The usual solution is to eith
 er make the values part of the page's <a shape="rect" href="navigation.html">Activation Context</a> (which means the values will be appended to the URL) or <a shape="rect" href="persistent-page-data.html">@Persist the properties</a> the values in the session.</p><h2 id="TapestryforJSFUsers-CustomandCompositeComponents">Custom and Composite Components</h2><p>With JSF, creating custom components is an <a shape="rect" class="external-link" href="http://jsfcorner.blogspot.com/2011/01/custom-components.html" >advanced topic</a>. In fact, many JSF developers have <em>never</em> created a custom component. In JSF 1.x, creating each custom component requires a lot of work: creating 3 Java classes (component, component renderer and component tag), registering the component in an XML file, and registering the tag in the .tld file. In JSF 2.x <em>composite components</em> can be created without too much work (if your needs can be met by combining existing components <em>and</em> you don't need
  any custom Java), but you still have to use cumbersome &lt;composite:interface&gt; and &lt;composite:implementation&gt; tags in your component templates, and you have to list the composite components in the xml namespace declaration at the top of the pages where you are using them.</p><p>Creating true custom components in JSF 2.0 still requires several steps: create a component class (generally having the @FacesComponent annotation and extending UIComponentBase), create a renderer class (generally extending Renderer), add a &lt;renderer&gt; section to the facesconfig file, and create a *-taglib.xml file in the WEB_INF folder that defines the namespace, tag and component type of the custom component.</p><p>In contrast, with Tapestry, <a shape="rect" href="component-classes.html">creating custom components</a> is a <em>beginner</em> topic: it is expected to be a daily activity for developers, because it is so easy. In fact, the steps are the same as creating a page. All you have to d
 o is create a (potentially empty) Java class in a "components" sub-package, and create a template file containing (X)HTML markup in the corresponding "components" sub-folder within your package hierarchy under /src/main/resources. You <em>use</em> a custom component just like you use any built-in Tapestry component: <code>&lt;t:mycomponent&gt;</code>.</p><p>Because they're so easy to create, Tapestry applications tend to have a lot of custom components and much less repetition of HTML than most JSF applications.</p><h2 id="TapestryforJSFUsers-OtherReferences">Other References</h2><ul><li><a shape="rect" class="external-link" href="http://blog.tapestry5.de/wp-content/uploads/2010/06/JSF-2.0-vs-Tapestry-5.pdf" >JavaServer Faces 2.0 vs. Tapestry 5: A Head-to-Head Comparison</a> slides by Igor Drobiazko, June 2010.</li><li><a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/6/tutorial/doc/gkhxa.html" >Composite Components: Advanced Topics and Example</a> part of <e
 m>The Java EE 6 Tutorial</em> from Oracle</li></ul></div>
+</div></div><h3 id="TapestryforJSFUsers-Post-Redirect-GetNavigation">Post-Redirect-Get Navigation</h3><p>By default, most JSF URLs are "one page behind". That is, when you click on an &lt;h:commandLink&gt; link or submit a form, the request goes back to the originating page, and the server returns the contents of the <strong>next</strong> page &#8211; but the URL in the browser shows the previous page's URL. To fix this in JSF you add the "?faces-redirect=true" to the URL you return from event handlers, which causes JSF to send a redirect to the browser to navigate to the next page.</p><p>By contrast, Tapestry implements this Post-Redirect-Get pattern by default. The URL will always reflect the page you're seeing, not the page you just came from.</p><p>Note that by default Tapestry does not save property values across the Post-Redirect-Get cycle. This means that you have to consider how (and whether) to persist property values from one page to the next. The usual solution is to eith
 er make the values part of the page's <a shape="rect" href="navigation.html">Activation Context</a> (which means the values will be appended to the URL) or <a shape="rect" href="persistent-page-data.html">@Persist the properties</a> the values in the session.</p><h2 id="TapestryforJSFUsers-CustomandCompositeComponents">Custom and Composite Components</h2><p>With JSF, creating custom components is an <a shape="rect" class="external-link" href="http://jsfcorner.blogspot.com/2011/01/custom-components.html" >advanced topic</a>. In fact, many JSF developers have <em>never</em> created a custom component. In JSF 1.x, creating each custom component requires a lot of work: creating 3 Java classes (component, component renderer and component tag), registering the component in an XML file, and registering the tag in the .tld file. In JSF 2.x <em>composite components</em> can be created without too much work (if your needs can be met by combining existing components <em>and</em> you don't need
  any custom Java), but you still have to use cumbersome &lt;composite:interface&gt; and &lt;composite:implementation&gt; tags in your component templates, and you have to list the composite components in the xml namespace declaration at the top of the pages where you are using them.</p><p>Creating true custom components in JSF 2.0 still requires several steps: create a component class (generally having the @FacesComponent annotation and extending UIComponentBase), create a renderer class (generally extending Renderer), add a &lt;renderer&gt; section to the facesconfig file, and create a *-taglib.xml file in the WEB_INF folder that defines the namespace, tag and component type of the custom component.</p><p>In contrast, with Tapestry, <a shape="rect" href="component-classes.html">creating custom components</a> is a <em>beginner</em> topic: it is expected to be a daily activity for developers, because it is so easy. In fact, the steps are the same as creating a page. All you have to d
 o is create a (potentially empty) Java class in a "components" sub-package, and create a template file containing (X)HTML markup in the corresponding "components" sub-folder within your package hierarchy under /src/main/resources. You <em>use</em> a custom component just like you use any built-in Tapestry component: <code>&lt;t:mycomponent&gt;</code>.</p><p>Because they're so easy to create, Tapestry applications tend to have a lot of custom components and much less repetition of HTML than most JSF applications.</p><h2 id="TapestryforJSFUsers-OtherReferences">Other References</h2><ul><li><a shape="rect" class="external-link" href="http://blog.tapestry5.de/wp-content/uploads/2010/06/JSF-2.0-vs-Tapestry-5.pdf" >JavaServer Faces 2.0 vs. Tapestry 5: A Head-to-Head Comparison</a> slides by Igor Drobiazko, June 2010.</li><li><a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/6/tutorial/doc/gkhxa.html" >Composite Components: Advanced Topics and Example</a> part of <e
 m>The Java EE 6 Tutorial</em> from Oracle</li></ul><p></p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/tapestry-inversion-of-control-faq.html
==============================================================================
--- websites/production/tapestry/content/tapestry-inversion-of-control-faq.html (original)
+++ websites/production/tapestry/content/tapestry-inversion-of-control-faq.html Sun Jul 26 23:19:56 2015
@@ -67,34 +67,56 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent">
+<div id="ConfluenceContent"><h2 id="TapestryInversionofControlFAQ-TapestryInversionofControlContainer">Tapestry Inversion of Control Container</h2><p>Main article: <a shape="rect" href="ioc.html">Tapestry IoC</a></p><p>&#160;</p><div class="aui-label" style="float:right" title="Related Articles">
 
-<h2 id="TapestryInversionofControlFAQ-TapestryInversionofControlContainer">Tapestry Inversion of Control Container</h2>
 
-<p>Main article: <a shape="rect" href="ioc.html">Tapestry IoC</a></p>
 
-<div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div>
 
-<h3 id="TapestryInversionofControlFAQ-WhydoIneedtodefineaninterfaceformyservices?Whycan'tIjustusetheclassitself?">Why do I need to define an interface for my services?  Why can't I just use the class itself?</h3>
 
-<p>First of all: you can do exactly this, but you lose some of the functionality that Tapestry's IoC container provides.</p>
 
-<p>The reason for the split is so that Tapestry can provide functionality for your service around the core service implementation.  It does this by creating <em>proxies</em>: Java classes that implement the service interface.  The methods of the proxy will ultimately invoke the methods of your service implementation.</p>
 
-<p>One of the primary purposes for proxies is to encapsulate the service's life cycle: most services are singletons that are created <em>just in time</em>.  Just in time means only as soon as you invoke a method.  What's going on is that the life cycle proxy (the object that gets injected into pages, components or other service implementations) checks on each method invocation to see if the actual service exists yet.  If not, it instantiates and configures it (using proper locking to ensure thread safety), then delegates the method invocation to the service.</p>
 
-<p>If you bind a service class (not a service interface and class), then the service is fully instantiated the first time it is injected, rather than at that first method invocation. Further, you can't use decorations or method advice on such a service.</p>
+<h3>Related Articles</h3>
 
-<p>The final reason for the service interface / implementation split is to nudge you towards always coding to an interface, which has manifest benefits for code structure, robustness, and testability.</p>
+<ul class="content-by-label"><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
 
-<h3 id="TapestryInversionofControlFAQ-Myservicestartsathread;howdoIknowwhentheapplicationisshuttingdown,tostopthatthread?">My service starts a thread; how do I know when the application is shutting down, to stop that thread?</h3>
+        <div class="details">
+                        <a shape="rect" href="ioc.html">IOC</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
 
-<p>This same concern applies to any long-lived resource (a thread, a database connection, a JMS queue connection) that a service may hold onto.  Your code needs to know when the application has been undeployed and shutdown.  This is actually quite easy, by adding some post-injection logic to your implementation class.</p>
+        <div class="details">
+                        <a shape="rect" href="ioc-cookbook.html">IoC cookbook</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
 
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: true; theme: Default" style="font-size:12px;">
-public class MyServiceImpl implements MyService
+        <div class="details">
+                        <a shape="rect" href="tapestry-ioc-overview.html">Tapestry IoC Overview</a>
+                
+                        
+                    </div>
+    </li><li>
+        <div>
+                <span class="icon aui-icon aui-icon-small aui-iconfont-page-default" title="Page">Page:</span>        </div>
+
+        <div class="details">
+                        <a shape="rect" href="tapestry-inversion-of-control-faq.html">Tapestry Inversion of Control FAQ</a>
+                
+                        
+                    </div>
+    </li></ul>
+</div><h3 id="TapestryInversionofControlFAQ-WhydoIneedtodefineaninterfaceformyservices?Whycan'tIjustusetheclassitself?">Why do I need to define an interface for my services? Why can't I just use the class itself?</h3><p>First of all: you can do exactly this, but you lose some of the functionality that Tapestry's IoC container provides.</p><p>The reason for the split is so that Tapestry can provide functionality for your service around the core service implementation. It does this by creating <em>proxies</em>: Java classes that implement the service interface. The methods of the proxy will ultimately invoke the methods of your service implementation.</p><p>One of the primary purposes for proxies is to encapsulate the service's life cycle: most services are singletons that are created <em>just in time</em>. Just in time means only as soon as you invoke a method. What's going on is that the life cycle proxy (the object that gets injected into pages, components or other service implemen
 tations) checks on each method invocation to see if the actual service exists yet. If not, it instantiates and configures it (using proper locking to ensure thread safety), then delegates the method invocation to the service.</p><p>If you bind a service class (not a service interface and class), then the service is fully instantiated the first time it is injected, rather than at that first method invocation. Further, you can't use decorations or method advice on such a service.</p><p>The final reason for the service interface / implementation split is to nudge you towards always coding to an interface, which has manifest benefits for code structure, robustness, and testability.</p><h3 id="TapestryInversionofControlFAQ-Myservicestartsathread;howdoIknowwhentheapplicationisshuttingdown,tostopthatthread?">My service starts a thread; how do I know when the application is shutting down, to stop that thread?</h3><p>This same concern applies to any long-lived resource (a thread, a database 
 connection, a JMS queue connection) that a service may hold onto. Your code needs to know when the application has been undeployed and shutdown. This is actually quite easy, by adding some post-injection logic to your implementation class.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: true; theme: Default" style="font-size:12px;">public class MyServiceImpl implements MyService
 {
   private boolean shuttingDown;
 
@@ -122,26 +144,7 @@ public class MyServiceImpl implements My
   }
 }
 </pre>
-</div></div>
-
-<p>After Tapestry invokes the constructor of the service implementation, and after it performs any field injections, it invokes post injection methods. The methods must be public and return void.  Parameters to a post injection method represent further injections ... in the above example, the RegistryShutdownHub is injected into the PostInjection method, since it is only used inside that one method.</p>
-
-<div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
-<p>It is <strong>not</strong> recommended that MyServiceImpl take RegistryShutdownHub as a constructor parameter and register itself as a listener inside the constructor. Doing so is an example of <a shape="rect" class="external-link" href="http://www.ibm.com/developerworks/java/library/j-jtp0618.html" >unsafe publishing</a>, a remote but potential thread safety issue.</p></div></div>
-
-<p>This same technique will work for any kind of resource that must be cleaned up or destroyed when the registry shuts down.</p>
-
-<div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
-<p>Be careful not to invoke methods on any service proxy objects as they will also be shutting down with the Registry. A RegistryShutdownListener should not be reliant on anything outside of itself.</p></div></div>
-
-<h3 id="TapestryInversionofControlFAQ-HowdoImakemyservicestartupwiththerestoftheapplication,ratherthanlazily?">How do I make my service startup with the rest of the application, rather than lazily?</h3>
-
-<p>Tapestry services are designed to be <em>lazy</em>; they are only fully realized when needed: when the first method on the service interface is invoked.</p>
-
-<p>Sometimes a service does extra work that is desirable at application startup: examples may be registering message handlers with a JMS implementation, or setting up indexing.  Since the service's constructor (or <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/PostInjection.html">@PostInjection</a> methods) are not invoked until the service is realized.</p>
-
-<p>The solution is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/EagerLoad.html">@EagerLoad</a> annotation; service implementation classes marked with this annotation are loaded when the Registry is first startup, rather than lazily.</p>
-</div>
+</div></div><p>After Tapestry invokes the constructor of the service implementation, and after it performs any field injections, it invokes post injection methods. The methods must be public and return void. Parameters to a post injection method represent further injections ... in the above example, the RegistryShutdownHub is injected into the PostInjection method, since it is only used inside that one method.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>It is <strong>not</strong> recommended that MyServiceImpl take RegistryShutdownHub as a constructor parameter and register itself as a listener inside the constructor. Doing so is an example of <a shape="rect" class="external-link" href="http://www.ibm.com/developerworks/java/library/j-jtp0618.html" >unsafe publishing</a>, a remote but potential threa
 d safety issue.</p></div></div><p>This same technique will work for any kind of resource that must be cleaned up or destroyed when the registry shuts down.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Be careful not to invoke methods on any service proxy objects as they will also be shutting down with the Registry. A RegistryShutdownListener should not be reliant on anything outside of itself.</p></div></div><h3 id="TapestryInversionofControlFAQ-HowdoImakemyservicestartupwiththerestoftheapplication,ratherthanlazily?">How do I make my service startup with the rest of the application, rather than lazily?</h3><p>Tapestry services are designed to be <em>lazy</em>; they are only fully realized when needed: when the first method on the service interface is invoked.</p><p>Sometimes a service does extra work t
 hat is desirable at application startup: examples may be registering message handlers with a JMS implementation, or setting up indexing. Since the service's constructor (or <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/PostInjection.html">@PostInjection</a> methods) are not invoked until the service is realized.</p><p>The solution is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/EagerLoad.html">@EagerLoad</a> annotation; service implementation classes marked with this annotation are loaded when the Registry is first startup, rather than lazily.</p></div>
 </div>
 
 <div class="clearer"></div>



Mime
View raw message