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 2015/07/19 23:21:30 UTC

svn commit: r958985 [14/29] - in /websites/production/tapestry/content: ./ 2009/09/13/ 2009/10/27/ 2009/11/25/ 2010/07/18/ 2010/07/24/ 2010/10/11/ 2010/10/31/ 2010/11/18/ 2010/12/16/ 2010/12/17/ 2011/01/18/ 2011/03/23/ 2011/03/29/ 2011/03/30/ 2011/03/3...

Modified: websites/production/tapestry/content/hibernate-user-guide.html
==============================================================================
--- websites/production/tapestry/content/hibernate-user-guide.html (original)
+++ websites/production/tapestry/content/hibernate-user-guide.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -65,7 +75,7 @@
 <p>Value encoders are automatically created for all mapped Hibernate entity types. This is done by encoding the entity as it's id (coerced to a String) and decoding the entity by looking it up in the Hibernate Session using the encoded id. Consider the following example:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class ViewPerson
 {
   @Property
@@ -80,16 +90,16 @@ public class ViewPerson
   {
     return person;
   }
-}]]></script>
+}</pre>
 </div></div>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;html xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_1_0.xsd&quot;&gt;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+&lt;html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"&gt;
 &lt;body&gt;
-  The person&#39;s name is: ${person.name}
+  The person's name is: ${person.name}
 &lt;/body&gt;
-&lt;/html&gt;]]></script>
+&lt;/html&gt;</pre>
 </div></div>
 
 <p>Accessing the page as <strong>/viewperson/152</strong> would load the Person entity with id 152 and use that as the page context.</p>
@@ -99,14 +109,14 @@ public class ViewPerson
 <p>If you prefer to use annotations, you may let Tapestry generate the page activation context handlers for you. Relying on an existing ValueEncoder for the corresponding property you can use the @PageActivationContext annotation. The disadvantage is that you can't access the handlers in a unit test.</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class ViewPerson
 {
   @Property
   @PageActivationContext
   private Person person;
   
-}]]></script>
+}</pre>
 </div></div>
 
 <h1 id="HibernateUserGuide-Using@Persistwithentities">Using @Persist with entities</h1>
@@ -114,10 +124,10 @@ public class ViewPerson
 <p>If you wish to persist an entity in the session, you may use the "entity" persistence strategy:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class ViewPerson
 {
-  @Persist(&quot;entity&quot;)
+  @Persist("entity")
   @Property
   private Person person;
   
@@ -126,7 +136,7 @@ public class ViewPerson
     this.person = person;
   }
   
-}]]></script>
+}</pre>
 </div></div>
 
 <p>This persistence strategy works with any Hibernate entity that is associated with a valid Hibernate Session by persisting only the id of the entity. Notice that no onPassivate() method is needed; when the page renders the entity is loaded by the id stored in the session.</p>
@@ -143,7 +153,7 @@ public class ViewPerson
 <p>The default strategy for persisting Session State Objects is "session". Storing a Hibernate entity into a &lt;HttpSession&gt; is problematic because the stored entity is detached from the Hibernate session. Similar to @Persist("entity") you may use the "entity" persistence strategy to persist Hibernate entities as SSOs:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class Index
 {
   @SessionState
@@ -153,27 +163,27 @@ public class Index
   ...
   
 }
-]]></script>
+</pre>
 </div></div>
 
 <p>For this purpose you need to set the value of the symbol &lt;HibernateSymbols.ENTITY_SESSION_STATE_PERSISTENCE_STRATEGY_ENABLED&gt; to &lt;true&gt;:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class AppModule
 {
     public static void contributeApplicationDefaults(MappedConfiguration&lt;String, String&gt; configuration)
     {
-        configuration.add(HibernateSymbols.ENTITY_SESSION_STATE_PERSISTENCE_STRATEGY_ENABLED, &quot;true&quot;);
+        configuration.add(HibernateSymbols.ENTITY_SESSION_STATE_PERSISTENCE_STRATEGY_ENABLED, "true");
     }
 }
-]]></script>
+</pre>
 </div></div>
 
 <p>Alternatively you can apply the "entity" persistence strategy to a single Hibernate entity:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class AppModule
 {
     public void contributeApplicationStateManager(MappedConfiguration&lt;Class, ApplicationStateContribution&gt; configuration)
@@ -181,7 +191,7 @@ public class AppModule
     	configuration.add(Person.class, new ApplicationStateContribution(HibernatePersistenceConstants.ENTITY));
     }
 }
-]]></script>
+</pre>
 </div></div>
 
 <h1 id="HibernateUserGuide-CommittingChanges">Committing Changes</h1>
@@ -191,10 +201,10 @@ public class AppModule
 <p>The correct way to commit the transaction is via the @CommitAfter annotation:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class EditPerson
 {
-  @Persist(&quot;entity&quot;)
+  @Persist("entity")
   @Property
   private Person person;
 
@@ -213,7 +223,7 @@ public class EditPerson
   {
     return personIndex;
   }
-}]]></script>
+}</pre>
 </div></div>
 
 <p>In this example, the Person object may be updated by a form; the form's success event handler method, onSuccess() has the @CommitAfter annotation.</p>
@@ -237,7 +247,7 @@ public class EditPerson
 <p>First definine your DAO's service interface:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public interface PersonDAO
 {
   Person findByName(String name);
@@ -250,31 +260,31 @@ public interface PersonDAO
 
   @CommitAfter
   void delete(Person person);
-}]]></script>
+}</pre>
 </div></div>
 
 <p>Next, define your service in your application's Module class:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
 public class AppModule
 {
    public static void bind(ServiceBinder binder)
    {
       binder.bind(PersonDAO.class, PersonDAOImpl.class);
    }
-}]]></script>
+}</pre>
 </div></div>
 
 <p>Finally, you should use the HibernateTransactionAdvisor to add transaction advice:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-    @Match(&quot;*DAO&quot;)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+    @Match("*DAO")
     public static void adviseTransactions(HibernateTransactionAdvisor advisor, MethodAdviceReceiver receiver)
     {
         advisor.addTransactionCommitAdvice(receiver);
-    }]]></script>
+    }</pre>
 </div></div>
 
 <p>This advice method is configured to match against any service whose id ends with "DAO", such as "PersonDAO".</p>

Modified: websites/production/tapestry/content/hibernate.html
==============================================================================
--- websites/production/tapestry/content/hibernate.html (original)
+++ websites/production/tapestry/content/hibernate.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 

Modified: websites/production/tapestry/content/how-to-upgrade.html
==============================================================================
--- websites/production/tapestry/content/how-to-upgrade.html (original)
+++ websites/production/tapestry/content/how-to-upgrade.html Sun Jul 19 21:21:27 2015
@@ -71,7 +71,7 @@
 
 <h2 id="HowtoUpgrade-AfterYouUpgrade">After You Upgrade</h2>
 
-<ol><li><strong>Remove cached JavaScript:</strong> Tapestry's internal JavaScript may change between releases, and your web browser may have cached the older version. If you have set a specific <a shape="rect" href="configuration.html#Configuration-tapestry.applicationversion">application version</a> in your application's module class (usually AppModule.java), you should increment it to ensure that the URLs to the JavaScript files will have a new version number in their paths. Doing so will cause the browser to download the latest versions from your server. Alternatively, you can just clear your browser's cache (and have all your developers and testers do the same). <em>This issue is usually not a problem on production servers, since you will likely increment the application version with each new production release.</em></li></ol></div>
+<ol><li><strong>Remove cached JavaScript:</strong> Tapestry's internal JavaScript may change between releases, and your web browser may have cached the older version. If you have set a specific <a shape="rect" href="configuration.html">application version</a> in your application's module class (usually AppModule.java), you should increment it to ensure that the URLs to the JavaScript files will have a new version number in their paths. Doing so will cause the browser to download the latest versions from your server. Alternatively, you can just clear your browser's cache (and have all your developers and testers do the same). <em>This issue is usually not a problem on production servers, since you will likely increment the application version with each new production release.</em></li></ol></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/https.html
==============================================================================
--- websites/production/tapestry/content/https.html (original)
+++ websites/production/tapestry/content/https.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -59,43 +69,43 @@
 <div id="content">
 <div id="ConfluenceContent"><h1 id="HTTPS-SecuringyourapplicationwithHTTPS">Securing your application with HTTPS</h1><pre>&#160;</pre><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>Tapestry assumes your application will be primarily deployed as a standard web application, using HTTP&#160;(not HTTPS) as the transport mechanism.</p><p>However, many applications will need to have some of their pages secured: only accessible via HTTPS. This could be a login page, or a product ordering wizard, or administrative pages.</p><p>All that is necessary to mark a page as secure is to add the @Secure annotation to the page class:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[@Secure
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Secure
 public class ProcessOrder
 {
   . . .
 }
-]]></script>
+</pre>
 </div></div><p>When a page is marked as secure, Tapestry will ensure that access to that page uses HTTPS. All links to the page will use the "https" protocol.</p><p>If an attempt is made to access a secure page using a non-secure request (a normal HTTP request), Tapestry will send an HTTPS redirect to the client.</p><p>Links to non-secure pages from a secure page will do the reverse: a complete URL with an "http" protocol will be used. In other words, Tapestry manages the transition from insecure to secure and back again.</p><p>Links to other (secure) pages <em>and to assets</em> will be based on relative URLs and, therefore, secure.</p><p>The rationale behind using secure links to assets from secure pages is that it prevents the client web browser from reporting a mixed security level.</p><h2 id="HTTPS-SecuringMultiplePages">Securing Multiple Pages</h2><p>Rather than placing an @Secure annotation on individual pages, it is possible to enable security for folders of pages. All pages
  in or beneath the folder will be secured.</p><p>This is accomplished by making a contribution to the MetaDataLocator service configuration. For example, to secure all pages in the "admin" folder:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public void contributeMetaDataLocator(MappedConfiguration&lt;String,String&gt; configuration)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">public void contributeMetaDataLocator(MappedConfiguration&lt;String,String&gt; configuration)
 {
-    configuration.add(&quot;admin:&quot; + MetaDataConstants.SECURE_PAGE, &quot;true&quot;);
+    configuration.add("admin:" + MetaDataConstants.SECURE_PAGE, "true");
 }
-]]></script>
+</pre>
 </div></div><p>Here "admin" is the folder name, and the colon is a separator between the folder name and the the meta data key. SECURE_PAGE is a public constant for value "tapestry.secure-page";</p><p>When Tapestry is determining if a page is secure or not, it starts by checking for the @Secure annotation, then it consults the MetaDataLocator service.</p><p>If you want to make your entire application secure:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public void contributeMetaDataLocator(MappedConfiguration&lt;String,String&gt; configuration)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">public void contributeMetaDataLocator(MappedConfiguration&lt;String,String&gt; configuration)
 {
-    configuration.add(MetaDataConstants.SECURE_PAGE, &quot;true&quot;);
+    configuration.add(MetaDataConstants.SECURE_PAGE, "true");
 }
-]]></script>
+</pre>
 </div></div><p>With no colon, the meta data applies to the entire application (including any component libraries used in the application).</p><h2 id="HTTPS-BaseURLSupport">Base URL Support</h2><p>When Tapestry switches back and forth between secure and unsecure mode, it must create a full URL (rather than a relative URL) that identifies the protocol, server host name and perhaps even a port number.</p><p>That can be a stumbling point, especially the server host name. In a cluster, behind a fire wall, the server host name available to Tapestry, via the <code>HttpServletRequest.getServerName()</code> method, is often <em>not</em> the server name the client web browser sees ... instead it is the name of the internal server behind the firewall. The firewall server has the correct name from the web browser's point of view.</p><p>Because of this, Tapestry includes a hook to allow you to override how these default URLs are created: the BaseURLSource service.</p><p>The default implementatio
 n is based on just the getServerName() method; it's often not the correct choice even for development.</p><p>Fortunately, it is very easy to override this implementation. Here's an example of an override that uses the default port numbers that the <a shape="rect" class="external-link" href="http://jetty.codehaus.org/jetty/" >Jetty servlet container</a> uses for normal HTTP (port 8080) and for secure HTTPS (port 8443):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    public static void contributeServiceOverride(MappedConfiguration&lt;Class,Object&gt; configuration)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    public static void contributeServiceOverride(MappedConfiguration&lt;Class,Object&gt; configuration)
     {
         BaseURLSource source = new BaseURLSource()
         {
             public String getBaseURL(boolean secure)
             {
-                String protocol = secure ? &quot;https&quot; : &quot;http&quot;;
+                String protocol = secure ? "https" : "http";
 
                 int port = secure ? 8443 : 8080;
 
-                return String.format(&quot;%s://localhost:%d&quot;, protocol, port);
+                return String.format("%s://localhost:%d", protocol, port);
             }
         };
 
         configuration.add(BaseURLSource.class, source);
     }
-]]></script>
-</div></div><p>This override is hardcoded to generate URLs for localhost; as such you might use it for development but certainly not in production.</p><h2 id="HTTPS-DevelopmentMode">Development Mode</h2><p>When working in development mode, the Secure annotation is ignored. This is controlled by the tapestry.secure-enabled <a shape="rect" href="configuration.html#Configuration-Configuration-ConfigurationSymbols">configuration symbol</a>.</p><h2 id="HTTPS-ApplicationServerConfiguration">Application Server Configuration</h2><p>Setting up HTTPS support varies from application server to application server.</p><ul><li>Jetty:<ul><li><a shape="rect" class="external-link" href="http://docs.codehaus.org/display/JETTY/How+to+configure+SSL" >Jetty 6</a></li></ul></li><li>Tomcat:<ul><li><a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Version 6.0</a></li><li><a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-5.5-doc/ssl-
 howto.html">Version 5.5</a></li></ul></li></ul></div>
+</pre>
+</div></div><p>This override is hardcoded to generate URLs for localhost; as such you might use it for development but certainly not in production.</p><h2 id="HTTPS-DevelopmentMode">Development Mode</h2><p>When working in development mode, the Secure annotation is ignored. This is controlled by the tapestry.secure-enabled <a shape="rect" href="configuration.html">configuration symbol</a>.</p><h2 id="HTTPS-ApplicationServerConfiguration">Application Server Configuration</h2><p>Setting up HTTPS support varies from application server to application server.</p><ul><li>Jetty:<ul><li><a shape="rect" class="external-link" href="http://docs.codehaus.org/display/JETTY/How+to+configure+SSL" >Jetty 6</a></li></ul></li><li>Tomcat:<ul><li><a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Version 6.0</a></li><li><a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html">Version 5.5</a></li></ul></li></ul></
 div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/implementing-the-hi-lo-guessing-game.html
==============================================================================
--- websites/production/tapestry/content/implementing-the-hi-lo-guessing-game.html (original)
+++ websites/production/tapestry/content/implementing-the-hi-lo-guessing-game.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -57,39 +67,31 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><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;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-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="exploring-the-project.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="exploring-the-project.html">Exploring the Project</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="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To Create User Forms</a></td><td colspan="1" rowspan="1" class="Sc
 rollbarNextIcon"><a shape="rect" href="using-beaneditform-to-create-user-forms.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><span style="line-height: 1.4285715;">Let's start building a basic Hi-Lo Guessing game.</span></p><p>In the game, the computer selects a number between 1 and 10. You try and guess the number, clicking links. At the end, the computer tells you how many guesses you required to identify the target number. Even a simple example like this will demonstrate several important concepts in Tapestry:</p><ul><li>Breaking an application into individual pages</li><li>Transferring information from one page to another</li><li>Responding to user interactions</li><li>Storing client information in the server-side session</li></ul><p>We'll build this little application in small pieces, using the kind of iterative development that Tapestry makes so easy.</p><p><span cla
 ss="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/hilo-flow.png" data-image-src="/confluence/download/attachments/23340505/hilo-flow.png?version=2&amp;modificationDate=1286814202000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527744" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="hilo-flow.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>Our page flow is very simple, consisting of three pages: Index (the starting page), Guess and GameOver. The Index page introduces the application and includes a link to start guessing. The Guess page presents the user with ten links, plus feedback such as "too low" or "too high". The GameOver page tells the user how many guesses they 
 took before finding the target number.</p><h1 id="ImplementingtheHi-LoGuessingGame-IndexPage">Index Page</h1><p>Let's get to work on the Index page and template. Make Index.tml look like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.tml</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;html t:type=&quot;layout&quot; title=&quot;Hi/Lo Guess&quot;
-    xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_4.xsd&quot;&gt;
+<div id="ConfluenceContent"><p><span style="line-height: 1.4285715;">Let's start building a basic Hi-Lo Guessing game.</span></p><p>In the game, the computer selects a number between 1 and 10. You try and guess the number, clicking links. At the end, the computer tells you how many guesses you required to identify the target number. Even a simple example like this will demonstrate several important concepts in Tapestry:</p><ul><li>Breaking an application into individual pages</li><li>Transferring information from one page to another</li><li>Responding to user interactions</li><li>Storing client information in the server-side session</li></ul><p>We'll build this little application in small pieces, using the kind of iterative development that Tapestry makes so easy.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/hilo-flow.png"></span></p><p>Our page flow is very simple, consisting of three page
 s: Index (the starting page), Guess and GameOver. The Index page introduces the application and includes a link to start guessing. The Guess page presents the user with ten links, plus feedback such as "too low" or "too high". The GameOver page tells the user how many guesses they took before finding the target number.</p><h1 id="ImplementingtheHi-LoGuessingGame-IndexPage">Index Page</h1><p>Let's get to work on the Index page and template. Make Index.tml look like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.tml</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;html t:type="layout" title="Hi/Lo Guess"
+    xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"&gt;
 
     &lt;p&gt;
-        I&#39;m thinking of a number between one and ten ...
+        I'm thinking of a number between one and ten ...
     &lt;/p&gt;
     &lt;p&gt;
-        &lt;a href=&quot;#&quot;&gt;start guessing&lt;/a&gt;
+        &lt;a href="#"&gt;start guessing&lt;/a&gt;
     &lt;/p&gt;
 
 &lt;/html&gt;
-]]></script>
+</pre>
 </div></div><p>And edit the corresponding Java class, Index.java, removing its body (but leaving the imports in place for now):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.java</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class Index
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">public class Index
 {
 }
-]]></script>
-</div></div><p>Running the application gives us our start:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/hilo-1.png" data-image-src="/confluence/download/attachments/23340505/hilo-1.png?version=3&amp;modificationDate=1416879474000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346889" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="hilo-1.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>However, clicking the link doesn't do anything yet, as its just a placeholder &lt;a&gt; tag, not an actual Tapestry component. Let's think about what should happen when the user clicks that link:</p><ul><li>A random target number between 1 and 10 should be selected</li><
 li>The number of guesses taken should be reset to 0</li><li>The user should be sent to the Guess page to make a guess</li></ul><p>Our first step is to find out when the user clicks that "start guessing" link. In a typical web application framework, we might start thinking about URLs and handlers and maybe some sort of XML configuration file. But this is Tapestry, so we're going to work with components and methods on our classes.</p><p>First, the component. We want to perform an action (selecting the number) before continuing on to the Guess page. The ActionLink component is just what we need; it creates a link with a URL that will trigger an action event in our code ... but that's getting ahead of ourselves. First up, convert the &lt;a&gt; tag to an ActionLink component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.tml (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;p&gt;
-        &lt;t:actionlink t:id=&quot;start&quot;&gt;start guessing&lt;/t:actionlink&gt;
+</pre>
+</div></div><p>Running the application gives us our start:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/hilo-1.png"></span></p><p>However, clicking the link doesn't do anything yet, as its just a placeholder &lt;a&gt; tag, not an actual Tapestry component. Let's think about what should happen when the user clicks that link:</p><ul><li>A random target number between 1 and 10 should be selected</li><li>The number of guesses taken should be reset to 0</li><li>The user should be sent to the Guess page to make a guess</li></ul><p>Our first step is to find out when the user clicks that "start guessing" link. In a typical web application framework, we might start thinking about URLs and handlers and maybe some sort of XML configuration file. But this is Tapestry, so we're going to work with components and methods on our classes.</p><p>First, the component. We want to perform an action (selecting t
 he number) before continuing on to the Guess page. The ActionLink component is just what we need; it creates a link with a URL that will trigger an action event in our code ... but that's getting ahead of ourselves. First up, convert the &lt;a&gt; tag to an ActionLink component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.tml (partial)</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">    &lt;p&gt;
+        &lt;t:actionlink t:id="start"&gt;start guessing&lt;/t:actionlink&gt;
     &lt;/p&gt;
-]]></script>
-</div></div><p>If you refresh the browser and hover your mouse over the "start guessing" link, you'll see that its URL is now /tutorial1/index.start, which identifies the name of the page ("index") and the id of the component ("start").</p><p>If you click the link now, you'll get an error:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image image-center" width="500" src="implementing-the-hi-lo-guessing-game.data/Application_Exception.png" data-image-src="/confluence/download/attachments/23340505/Application_Exception.png?version=1&amp;modificationDate=1428077959000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="55476323" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Application_Exception.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resourc
 e-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>&#160;</p><p>Tapestry is telling us that we need to provide some kind of event handler for that event. What does that look like?</p><p>An event handler is a method of the Java class with a special name. The name is <code>on</code><strong><em>Eventname</em></strong><code>From</code><strong><em>Component-id</em></strong> ... here we want a method named <code>onActionFromStart()</code>. How do we know that "action" is the right event name? Because that's what ActionLink does, that's why its named <strong><em>Action</em></strong>Link.</p><p>Once again, Tapestry gives us options; if you don't like naming conventions, there's an @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/OnEvent.html">OnEvent</a> annotation you can place on the method instead, which restores the freedom to name the method as you like. Details about this approach 
 are in the <a shape="rect" href="component-events.html">Tapestry Users' Guide</a>. We'll be sticking with the naming convention approach for the tutorial.</p><p>When handling a component event request (the kind of request triggered by the ActionLink component's URL), Tapestry will find the component and trigger a component event on it. This is the callback our server-side code needs to figure out what the user is doing on the client side. Let's start with an empty event handler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.java</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages;
+</pre>
+</div></div><p>If you refresh the browser and hover your mouse over the "start guessing" link, you'll see that its URL is now /tutorial1/index.start, which identifies the name of the page ("index") and the id of the component ("start").</p><p>If you click the link now, you'll get an error:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image image-center" width="500" src="implementing-the-hi-lo-guessing-game.data/Application_Exception.png"></span></p><p>&#160;</p><p>Tapestry is telling us that we need to provide some kind of event handler for that event. What does that look like?</p><p>An event handler is a method of the Java class with a special name. The name is <code>on</code><strong><em>Eventname</em></strong><code>From</code><strong><em>Component-id</em></strong> ... here we want a method named <code>onActionFromStart()</code>. How do we know that "action" is the right event name? Because
  that's what ActionLink does, that's why its named <strong><em>Action</em></strong>Link.</p><p>Once again, Tapestry gives us options; if you don't like naming conventions, there's an @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/OnEvent.html">OnEvent</a> annotation you can place on the method instead, which restores the freedom to name the method as you like. Details about this approach are in the <a shape="rect" href="component-events.html">Tapestry Users' Guide</a>. We'll be sticking with the naming convention approach for the tutorial.</p><p>When handling a component event request (the kind of request triggered by the ActionLink component's URL), Tapestry will find the component and trigger a component event on it. This is the callback our server-side code needs to figure out what the user is doing on the client side. Let's start with an empty event handler:</p><div class="code panel pdl" style="border-wid
 th: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.java</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package com.example.tutorial.pages;
 
 public class Index
 {
@@ -98,9 +100,9 @@ public class Index
 
     }
 }
-]]></script>
+</pre>
 </div></div><p>In the browser, we can re-try the failed component event request by hitting the refresh button ... or we can restart the application. In either case, we get the default behavior, which is simply to re-render the page.</p><p>Note that the event handler method does not have to be public; it can be protected, private, or package private (as in this example). By convention, such methods are package private, if for no other reason than it is the minimal amount of characters to type.</p><p>Hmm... right now you have to trust us that the method got invoked. That's no good ... what's a quick way to tell for sure? One way would be have the method throw an exception, but that's a bit ugly.</p><p>How about this: add the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Log.html">Log</a> annotation to the method:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" s
 tyle="border-bottom-width: 1px;"><b>Index.java (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[import org.apache.tapestry5.annotations.Log;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">import org.apache.tapestry5.annotations.Log;
 
 . . .
 
@@ -109,7 +111,7 @@ public class Index
     {
 
     }
-]]></script>
+</pre>
 </div></div><p>When you next click the link you should see the following in the Eclipse console:</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>[DEBUG] pages.Index [ENTER] onActionFromStart()
 [DEBUG] pages.Index [ EXIT] onActionFromStart
@@ -117,7 +119,7 @@ public class Index
 [INFO] AppModule.TimingFilter Request time: 5 ms
 </pre>
 </div></div><p>The @Log annotation directs Tapestry to log method entry and exit. You'll get to see any parameters passed into the method, and any return value from the method ... as well as any exception thrown from within the method. It's a powerful debugging tool. This is an example of Tapestry's meta-programming power, something we'll use quite a bit of in the tutorial.</p><p>Why do we see two requests for one click? Tapestry uses an approach based on the <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Post/Redirect/Get" >Post/Redirect/Get</a> pattern. In fact, Tapestry generally performs a redirect after each component event. So the first request was to process the action, and the second request was to re-render the Index page. You can see this in the browser, because the URL is still "/tutorial1" (the URL for rendering the Index page). We'll return to this in a bit.</p><p>We're ready for the next step, which involves tying together the Index and Guess 
 pages. Index will select a target number for the user to Guess, then "pass the baton" to the Guess page.</p><p>Let's start by thinking about the Guess page. It needs a variable to store the target value in, and it needs a method that the Index page can invoke, to set up that target value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.java</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package com.example.tutorial.pages;
 
 public class Guess
 {
@@ -128,9 +130,9 @@ public class Guess
         this.target = target;
     }
 }
-]]></script>
+</pre>
 </div></div><p>Create that Guess.java file in the same folder as Index.java. Next, we can modify Index to invoke the <code>setup()</code> method of our new Guess page class:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Index.java (revised)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package com.example.tutorial.pages;
 
 import java.util.Random;
 
@@ -153,30 +155,30 @@ public class Index
         return guess;
     }
 }
-]]></script>
-</div></div><p>The new event handler method now chooses the target number, and tells the Guess page about it. Because Tapestry is a managed environment, we don't just create an instance of Guess ... it is Tapestry's responsibility to manage the life cycle of the Guess page. Instead, we ask Tapestry for the Guess page, using the @InjectPage annotation.</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>All fields in a Tapestry page or component class must be <strong>non-public</strong>.</p></div></div><p>Once we have that Guess page instance, we can invoke methods on it normally.</p><p>Returning a page instance from an event handler method directs Tapestry to send a client-side redirect to the returned page, rather than sending a redirect for the active page. Thus once the user clicks the "start guessing" lin
 k, they'll see the Guess page.</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>When creating your own applications, make sure that the objects stored in final variables are thread safe. It seems counter-intuitive, but final variables are shared across many threads. Ordinary instance variables are not. Fortunately, the implementation of Random is, in fact, thread safe.</p></div></div><p>So ... let's click the link and see what we get:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-template-missing.png" data-image-src="/confluence/download/attachments/23340505/guess-template-missing.png?version=2&amp;modificationDate=1416710821000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346891"
  data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="guess-template-missing.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>Ah! We didn't create a Guess page template. Tapestry was really expecting us to create one, so we better do so.</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/Guess.tml</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;html t:type=&quot;layout&quot; title=&quot;Guess The Number&quot;
-    xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_4.xsd&quot;&gt;
+</pre>
+</div></div><p>The new event handler method now chooses the target number, and tells the Guess page about it. Because Tapestry is a managed environment, we don't just create an instance of Guess ... it is Tapestry's responsibility to manage the life cycle of the Guess page. Instead, we ask Tapestry for the Guess page, using the @InjectPage annotation.</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>All fields in a Tapestry page or component class must be <strong>non-public</strong>.</p></div></div><p>Once we have that Guess page instance, we can invoke methods on it normally.</p><p>Returning a page instance from an event handler method directs Tapestry to send a client-side redirect to the returned page, rather than sending a redirect for the active page. Thus once the user clicks the "start guessing" lin
 k, they'll see the Guess page.</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>When creating your own applications, make sure that the objects stored in final variables are thread safe. It seems counter-intuitive, but final variables are shared across many threads. Ordinary instance variables are not. Fortunately, the implementation of Random is, in fact, thread safe.</p></div></div><p>So ... let's click the link and see what we get:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-template-missing.png"></span></p><p>Ah! We didn't create a Guess page template. Tapestry was really expecting us to create one, so we better do so.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader pan
 elHeader pdl" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/Guess.tml</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">&lt;html t:type="layout" title="Guess The Number"
+    xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"&gt;
 
     &lt;p&gt;
         The secret number is: ${target}.
     &lt;/p&gt;
   
 &lt;/html&gt;
-]]></script>
-</div></div><p>Hit the browser's back button, then click the "start guessing" link again. We're getting closer:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-no-target-prop.png" data-image-src="/confluence/download/attachments/23340505/guess-no-target-prop.png?version=2&amp;modificationDate=1416711075000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346892" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="guess-no-target-prop.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>If you scroll down, you'll see the line of the Guess.tml template that has the error. We have a field named target, but it is private and there's no corresponding property, so 
 Tapestry was unable to access it.</p><p>We just need to write the missing JavaBeans accessor methods <code>getTarget()</code> (and <code>setTarget()</code> for good measure). Or we could let Tapestry write those methods instead:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    @Property
+</pre>
+</div></div><p>Hit the browser's back button, then click the "start guessing" link again. We're getting closer:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-no-target-prop.png"></span></p><p>If you scroll down, you'll see the line of the Guess.tml template that has the error. We have a field named target, but it is private and there's no corresponding property, so Tapestry was unable to access it.</p><p>We just need to write the missing JavaBeans accessor methods <code>getTarget()</code> (and <code>setTarget()</code> for good measure). Or we could let Tapestry write those methods instead:</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;">    @Property
     private int target;
-]]></script>
-</div></div><p>The @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Property.html">Property</a> annotation very simply directs Tapestry to write the getter and setter method for you. You only need to do this if you are going to reference the field from the template.</p><p>We are getting very close but there's one last big oddity to handle. Once you refresh the page you'll see that target is 0!</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-target-zero.png" data-image-src="/confluence/download/attachments/23340505/guess-target-zero.png?version=3&amp;modificationDate=1416879255000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346893" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="guess-target-zero.png" data-base-url="https://cwiki.
 apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>What gives? We know it was set to at least 1 ... where did the value go?</p><p>As noted above, Tapestry sends a redirect to the client after handling the event request. That means that the rendering of the page happens in an entirely new request. Meanwhile, at the end of each request, Tapestry wipes out the value in each instance variable. So that means that target <em>was</em> a non-zero number during the component event request ... but by the time the new page render request comes up from the web browser to render the Guess page, the value of the target field has reverted back to its default, zero.</p><p>The solution here is to mark which fields have values that should persist from one request to the next (and next, and next ...). That's what the @<a shape="rect" class="external-link" href="http://tapestry.apach
 e.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html">Persist</a> annotation is for:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    @Property  
+</pre>
+</div></div><p>The @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Property.html">Property</a> annotation very simply directs Tapestry to write the getter and setter method for you. You only need to do this if you are going to reference the field from the template.</p><p>We are getting very close but there's one last big oddity to handle. Once you refresh the page you'll see that target is 0!</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-target-zero.png"></span></p><p>What gives? We know it was set to at least 1 ... where did the value go?</p><p>As noted above, Tapestry sends a redirect to the client after handling the event request. That means that the rendering of the page happens in an entirely new request. Meanwhile, at the end of each request, Tapestry wipes out the value in each instance variable. So that me
 ans that target <em>was</em> a non-zero number during the component event request ... but by the time the new page render request comes up from the web browser to render the Guess page, the value of the target field has reverted back to its default, zero.</p><p>The solution here is to mark which fields have values that should persist from one request to the next (and next, and next ...). That's what the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html">Persist</a> annotation is for:</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;">    @Property  
     @Persist
     private int target;
-]]></script>
-</div></div><p>This doesn't have anything to do with database persistence (that's coming up in a later chapter). It means that the value is stored in the HttpSession between requests.</p><p>Go back to the Index page and click the link again. Finally, we have a target number:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-target.png" data-image-src="/confluence/download/attachments/23340505/guess-target.png?version=3&amp;modificationDate=1416879254000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346894" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="guess-target.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>That's enough for us to get started.
  Let's build out the Guess page, and get ready to let the user make guesses. We'll show the count of guesses, and increment that count when they make them. We'll worry about high and low and actually selecting the correct value later.</p><p>When building Tapestry pages, you sometimes start with the Java code and build the template to match, and sometime start with the template and build the Java code to match. Both approaches are valid. Here, lets start with the markup in the template, then figure out what we need in the Java code to make it work.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.tml (revised)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;html t:type=&quot;layout&quot; title=&quot;Guess The Number&quot;
-    xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_4.xsd&quot;
-    xmlns:p=&quot;tapestry:parameter&quot;&gt;
+</pre>
+</div></div><p>This doesn't have anything to do with database persistence (that's coming up in a later chapter). It means that the value is stored in the HttpSession between requests.</p><p>Go back to the Index page and click the link again. Finally, we have a target number:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-target.png"></span></p><p>That's enough for us to get started. Let's build out the Guess page, and get ready to let the user make guesses. We'll show the count of guesses, and increment that count when they make them. We'll worry about high and low and actually selecting the correct value later.</p><p>When building Tapestry pages, you sometimes start with the Java code and build the template to match, and sometime start with the template and build the Java code to match. Both approaches are valid. Here, lets start with the markup in the template, then figure out what we
  need in the Java code to make it work.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.tml (revised)</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;html t:type="layout" title="Guess The Number"
+    xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
+    xmlns:p="tapestry:parameter"&gt;
  
     &lt;p&gt;
         The secret number is: ${target}.
@@ -186,19 +188,19 @@ public class Index
  
     &lt;p&gt;Make a guess from the options below:&lt;/p&gt;
  
-    &lt;ul class=&quot;list-inline&quot;&gt;
-        &lt;t:loop source=&quot;1..10&quot; value=&quot;current&quot;&gt;
+    &lt;ul class="list-inline"&gt;
+        &lt;t:loop source="1..10" value="current"&gt;
             &lt;li&gt;
-            &lt;t:actionlink t:id=&quot;makeGuess&quot; context=&quot;current&quot;&gt;${current}
+            &lt;t:actionlink t:id="makeGuess" context="current"&gt;${current}
             &lt;/t:actionlink&gt;
             &lt;/li&gt;
         &lt;/t:loop&gt;
     &lt;/ul&gt;
  
 &lt;/html&gt;
-]]></script>
+</pre>
 </div></div><p>So it looks like we need a <code>guessCount</code> property that starts at 1.</p><p>We're also seeing one new component, the Loop component. A Loop component iterates over the values passed to it in its <code>source</code> parameter, and renders it body once for each value. It updates the property bound to its <code>value</code> parameter before rendering its body.</p><p>That special property expression, <code>1..10</code>, generates a series of numbers from 1 to 10, inclusive. usually, when you use the Loop component, you are iterating over a List or Collection of values, such as the results of a database query.</p><p>So, the Loop component is going to set the <code>current</code> property to 1, and render its body (the \&lt;li\&gt; tag, and the ActionLink component). Then its going to set the <code>current</code> property to 2 and render its body again ... all the way up to 10.</p><p>And notice what we're doing with the ActionLink component; its no longer enough to 
 know the user clicked on the ActionLink ... we need to know <em>which iteration</em> the user clicked on. The <code>context</code> parameter allows a value to be added to the ActionLink's URL, and we can get it back in the event handler method.</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The URL for the ActionLink will be <code>/tutorial1/guess.makeguess/3</code>. That's the page name, "Guess", the component id, "makeGuess", and the context value, "3".</p></div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.java (revised)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package com.example.tutorial.pages;
 
 import org.apache.tapestry5.annotations.Persist;
 import org.apache.tapestry5.annotations.Property;
@@ -224,17 +226,17 @@ public class Guess
     }
 
 }
-]]></script>
-</div></div><p>The revised version of Guess includes two new properties: <code>current</code> and <code>guessCount</code>. There's also a handler for the action event from the makeGuess ActionLink component; currently it just increments the count.</p><p>Notice that the <code>onActionFromMakeGuess()</code> method now has a parameter: the context value that was encoded into the URL by the ActionLink. When then user clicks the link, Tapestry will automatically extract the string from the URL, convert it to an int and pass that int value into the event handler method. More boilerplate code you don't have to write.</p><p>At this point, the page is partially operational:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-1.png" data-image-src="/confluence/download/attachments/23340505/guess-1.png?version=4&amp;modificationDate=1416879255000&amp;api=v2" data-unresolved-comment-count="0" data-linke
 d-resource-id="24346895" data-linked-resource-version="4" data-linked-resource-type="attachment" data-linked-resource-default-alias="guess-1.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>Our next step is to actually check the value provided by the user against the target and provide feedback: either they guessed too high, or too low, or just right. If they get it just right, we'll switch to the GameOver page with a message such as "You guessed the number 5 in 2 guesses".</p><p>Let's start with the Guess page; it now needs a new property to store the message to be displayed to the user, and needs a field for the injected GameOver page:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.java (partial)</b></div><div class="codeContent panel
 Content pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    @Property
+</pre>
+</div></div><p>The revised version of Guess includes two new properties: <code>current</code> and <code>guessCount</code>. There's also a handler for the action event from the makeGuess ActionLink component; currently it just increments the count.</p><p>Notice that the <code>onActionFromMakeGuess()</code> method now has a parameter: the context value that was encoded into the URL by the ActionLink. When then user clicks the link, Tapestry will automatically extract the string from the URL, convert it to an int and pass that int value into the event handler method. More boilerplate code you don't have to write.</p><p>At this point, the page is partially operational:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/guess-1.png"></span></p><p>Our next step is to actually check the value provided by the user against the target and provide feedback: either they guessed too high, or too low, or just 
 right. If they get it just right, we'll switch to the GameOver page with a message such as "You guessed the number 5 in 2 guesses".</p><p>Let's start with the Guess page; it now needs a new property to store the message to be displayed to the user, and needs a field for the injected GameOver page:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.java (partial)</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    @Property
     @Persist(PersistenceConstants.FLASH)
     private String message;
 
     @InjectPage
     private GameOver gameOver;
-]]></script>
+</pre>
 </div></div><p>First off, we're seeing a variation of the @Persist annotation, where a persistence <em>strategy</em> is provided by name. <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/PersistenceConstants.html#FLASH">FLASH</a> is a built-in strategy that stores the value in the session, but only for one request ... it's designed specifically for these kind of feedback messages. If you hit F5 in the browser, to refresh, the page will render but the message will disappear.</p><p>Next, we need some more logic in the <code>onActionFromMakeGuess()</code> event handler method:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.java (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    Object onActionFromMakeGuess(int value)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    Object onActionFromMakeGuess(int value)
     {
         if (value == target)
         {
@@ -244,23 +246,23 @@ public class Guess
 
         guessCount++;
 
-        message = String.format(&quot;Your guess of %d is too %s.&quot;, value,
-            value &lt; target ? &quot;low&quot; : &quot;high&quot;);
+        message = String.format("Your guess of %d is too %s.", value,
+            value &lt; target ? "low" : "high");
 
         return null;
     }
-]]></script>
+</pre>
 </div></div><p>Again, very straight-forward. If the value is correct, then we configure the GameOver page and return it, causing a redirect to that page. Otherwise, we increment the number of guesses, and format the message to display to the user.</p><p>In the template, we just need to add some markup to display the message:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Guess.tml (partial)</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;strong&gt;Guess number ${guessCount}&lt;/strong&gt;
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">    &lt;strong&gt;Guess number ${guessCount}&lt;/strong&gt;
 
-    &lt;t:if test=&quot;message&quot;&gt;
+    &lt;t:if test="message"&gt;
         &lt;p&gt;
             &lt;strong&gt;${message}&lt;/strong&gt;
         &lt;/p&gt;
     &lt;/t:if&gt;
-]]></script>
+</pre>
 </div></div><p>This snippet uses Tapestry's <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/If.html">If</a> component. The If component evaluates its <code>test</code> parameter and, if the value evaluates to true, renders its body. The property bound to <code>test</code> doesn't have to be a boolean; Tapestry treats <code>null</code> as false, it treats zero as false and non-zero as true, it treats an empty Collection as false ... and for Strings (such as <code>message</code>) it treats a blank string (one that is null, or consists only of white space) as false, and a non-blank string is true.</p><p>We can wrap up with the "GameOver" page:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>GameOver.java</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package com.example.tutorial.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package com.example.tutorial.pages;
 
 import org.apache.tapestry5.annotations.Persist;
 import org.apache.tapestry5.annotations.Property;
@@ -277,11 +279,11 @@ public class GameOver
         this.guessCount = guessCount;
     }
 }
-]]></script>
+</pre>
 </div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>GameOver.tml</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;html t:type=&quot;layout&quot; title=&quot;Game Over&quot;
-    xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_4.xsd&quot;
-    xmlns:p=&quot;tapestry:parameter&quot;&gt;
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;html t:type="layout" title="Game Over"
+    xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
+    xmlns:p="tapestry:parameter"&gt;
 
     &lt;p&gt;
         You guessed the number
@@ -292,16 +294,8 @@ public class GameOver
     &lt;/p&gt;
   
 &lt;/html&gt;
-]]></script>
-</div></div><p>The result, when you guess correctly, should be this:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/gameover.png" data-image-src="/confluence/download/attachments/23340505/gameover.png?version=4&amp;modificationDate=1416879255000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347015" data-linked-resource-version="4" data-linked-resource-type="attachment" data-linked-resource-default-alias="gameover.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340505" data-linked-resource-container-version="47"></span></p><p>That wraps up the basics of Tapestry; we've demonstrated the basics of linking pages together and passing information from page to page in code as well as incorporating data inside URLs.</p><p>There's still more room to refactor this toy application; for 
 example, making it possible to start a new game from the GameOver page (and doing it in a way that doesn't duplicate code). In addition, later we'll see other ways of sharing information between pages that are less cumbersome than the setup-and-persist approach shown here.</p><p>Next up, we'll start delving into how Tapestry handles HTML forms and user input.&#160;</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;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-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="exploring-the-project.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="exploring-the-project.html">Exploring the Project</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="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To Create User Forms</a></td><td colspan="1" rowspan="1" class="Sc
 rollbarNextIcon"><a shape="rect" href="using-beaneditform-to-create-user-forms.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>
+</pre>
+</div></div><p>The result, when you guess correctly, should be this:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="implementing-the-hi-lo-guessing-game.data/gameover.png"></span></p><p>That wraps up the basics of Tapestry; we've demonstrated the basics of linking pages together and passing information from page to page in code as well as incorporating data inside URLs.</p><p>There's still more room to refactor this toy application; for example, making it possible to start a new game from the GameOver page (and doing it in a way that doesn't duplicate code). In addition, later we'll see other ways of sharing information between pages that are less cumbersome than the setup-and-persist approach shown here.</p><p>Next up, we'll start delving into how Tapestry handles HTML forms and user input.&#160;</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/index.html
==============================================================================
--- websites/production/tapestry/content/index.html (original)
+++ websites/production/tapestry/content/index.html Sun Jul 19 21:21:27 2015
@@ -131,19 +131,19 @@ a.blogHeading {
 
 
 <div class="clearer"></div></div><div id="bar"><p><strong>We think you will love Tapestry!</strong> Give us 20 minutes and <strong><a shape="rect" href="getting-started.html">follow our quickstart guide</a></strong>.</p></div><div id="col"><a shape="rect" class="twitter-timeline" href="https://twitter.com/hashtag/tapestry5" data-widget-id="585196873335574528">#tapestry5 Tweets</a>
-&#160;<h3 id="Index-Latestnews"><a shape="rect" href="news.html">Latest news</a> <a shape="rect" href="https://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&amp;spaces=TAPESTRY&amp;title=Apache+Tapestry+News+RSS+Feed&amp;labelString%3D&amp;sort=created&amp;maxResults=10&amp;timeSpan=12&amp;confirm=Create&amp;showContent=true&amp;showDiff=false"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="index.data/Feed-icon.gif" data-image-src="/confluence/download/attachments/24189566/Feed-icon.gif?version=1&amp;modificationDate=1292052584000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347025" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Feed-icon.gif" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/gif" data-linked-resource-container-id="24189566" data-linked-resource-container-version="318"></span
 ></a></h3>    
+&#160;<h3 id="Index-Latestnews"><a shape="rect" href="news.html">Latest news</a> <a shape="rect" href="https://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&amp;spaces=TAPESTRY&amp;title=Apache+Tapestry+News+RSS+Feed&amp;labelString%3D&amp;sort=created&amp;maxResults=10&amp;timeSpan=12&amp;confirm=Create&amp;showContent=true&amp;showDiff=false"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="index.data/Feed-icon.gif"></span></a></h3>    
 
     
         
 <div class="blog-post-listing">
             <div class="logo-heading-block">
             <span class="logoBlock">
-                <a shape="rect" class="userLogoLink" href="    /confluence/display/~hlship ">
-               <img class="userLogo logo" src="https://cwiki.apache.org/confluence/images/icons/profilepics/default.png" alt="User icon: hlship" title="hlship">
+                <a shape="rect" class="userLogoLink" href="https://cwiki.apache.org/confluence/display/~hlship">
+               <img class="userLogo logo" src="/images/confluence/icons/profilepics/default.png" alt="User icon: hlship" title="hlship">
            </a>            </span>
             <span class="blogHeading">
                 <a shape="rect" class="blogHeading" href="2015/01/19/tapestry-54-beta-26.html">Tapestry 5.4-beta-26</a>
-                </span><div class="page-metadata not-personal">    <a shape="rect" class="url fn confluence-userlink" href="    /confluence/display/~hlship ">Howard M. Lewis Ship</a> posted on Jan 19, 2015</div>
+                </span><div class="page-metadata not-personal">    <a shape="rect" class="url fn confluence-userlink" href="https://cwiki.apache.org/confluence/display/~hlship">Howard M. Lewis Ship</a> posted on Jan 19, 2015</div>
             
         </div>
     
@@ -158,12 +158,12 @@ a.blogHeading {
 <div class="blog-post-listing">
             <div class="logo-heading-block">
             <span class="logoBlock">
-                <a shape="rect" class="userLogoLink" href="    /confluence/display/~kaosko ">
-               <img class="userLogo logo" src="https://cwiki.apache.org/confluence/images/icons/profilepics/default.png" alt="User icon: kaosko" title="kaosko">
+                <a shape="rect" class="userLogoLink" href="https://cwiki.apache.org/confluence/display/~kaosko">
+               <img class="userLogo logo" src="/images/confluence/icons/profilepics/default.png" alt="User icon: kaosko" title="kaosko">
            </a>            </span>
             <span class="blogHeading">
                 <a shape="rect" class="blogHeading" href="2014/12/11/tapestry-538.html">Tapestry 5.3.8</a>
-                </span><div class="page-metadata not-personal">    <a shape="rect" class="url fn confluence-userlink" href="    /confluence/display/~kaosko ">Kalle Korhonen</a> posted on Dec 11, 2014</div>
+                </span><div class="page-metadata not-personal">    <a shape="rect" class="url fn confluence-userlink" href="https://cwiki.apache.org/confluence/display/~kaosko">Kalle Korhonen</a> posted on Dec 11, 2014</div>
             
         </div>
     
@@ -188,12 +188,12 @@ Tapestry 5.3.8 is the latest maintenance
 <div class="blog-post-listing">
             <div class="logo-heading-block">
             <span class="logoBlock">
-                <a shape="rect" class="userLogoLink" href="    /confluence/display/~hlship ">
-               <img class="userLogo logo" src="https://cwiki.apache.org/confluence/images/icons/profilepics/default.png" alt="User icon: hlship" title="hlship">
+                <a shape="rect" class="userLogoLink" href="https://cwiki.apache.org/confluence/display/~hlship">
+               <img class="userLogo logo" src="/images/confluence/icons/profilepics/default.png" alt="User icon: hlship" title="hlship">
            </a>            </span>
             <span class="blogHeading">
                 <a shape="rect" class="blogHeading" href="2014/09/25/tapestry-54-beta-22.html">Tapestry 5.4-beta-22</a>
-                </span><div class="page-metadata not-personal">    <a shape="rect" class="url fn confluence-userlink" href="    /confluence/display/~hlship ">Howard M. Lewis Ship</a> posted on Sep 25, 2014</div>
+                </span><div class="page-metadata not-personal">    <a shape="rect" class="url fn confluence-userlink" href="https://cwiki.apache.org/confluence/display/~hlship">Howard M. Lewis Ship</a> posted on Sep 25, 2014</div>
             
         </div>
     
@@ -525,7 +525,7 @@ This release is available from the Maven
 
 </div> 
 
-</div> <p>More on <a shape="rect" href="principles.html">Tapestry philosophy</a> - Who uses <a shape="rect" href="applications.html">Tapestry </a>? <a shape="rect" class="external-link" href="http://twitter.com/apachetapestry" ><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="index.data/twitterTapestry.png" data-image-src="/confluence/download/attachments/24189566/twitterTapestry.png?version=2&amp;modificationDate=1292947176000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347094" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="twitterTapestry.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="24189566" data-linked-resource-container-version="318"></span></a></p></div><div style="clear:both">&#160;</div></div>
+</div> <p>More on <a shape="rect" href="principles.html">Tapestry philosophy</a> - Who uses <a shape="rect" href="applications.html">Tapestry </a>? <a shape="rect" class="external-link" href="http://twitter.com/apachetapestry" ><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="index.data/twitterTapestry.png"></span></a></p></div><div style="clear:both">&#160;</div></div>
 <div id="footer">
 <div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.<br clear="none">
 </p><p><script type="text/javascript">