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

svn commit: r924825 - in /websites/production/tapestry/content: cache/main.pageCache implementing-the-hi-lo-guessing-game.html

Author: buildbot
Date: Mon Oct  6 13:19:37 2014
New Revision: 924825

Log:
Production update by buildbot for tapestry

Modified:
    websites/production/tapestry/content/cache/main.pageCache
    websites/production/tapestry/content/implementing-the-hi-lo-guessing-game.html

Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

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 Mon Oct  6 13:19:37 2014
@@ -199,7 +199,7 @@ public class Index
   @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><img class="confluence-embedded-image" width="700" src="https://cwiki.apache.org/confluence/download/attachments/23340505/guess-target.png?version=1&amp;modificationDate=1290116253000&amp;api=v2" data-image-src="/confluence/download/attachments/23340505/guess-target.png?version=1&amp;modificationDate=1290116253000&amp;api=v2"></p><p>That 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">
+</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><img class="confluence-embedded-image" width="700" src="https://cwiki.apache.org/confluence/download/attachments/23340505/guess-target.png?version=1&amp;modificationDate=1290116253000&amp;api=v2" data-image-src="/confluence/download/attachments/23340505/guess-target.png?version=1&amp;modificationDate=1290116253000&amp;api=v2"></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, a
 nd 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="theme: Default; brush: xml; gutter: false" 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_3.xsd&quot;
   xmlns:p=&quot;tapestry:parameter&quot;&gt;
@@ -210,7 +210,7 @@ public class Index
   &lt;/p&gt;
   &lt;/p:sidebar&gt;
 
-  &lt;strong&gt;Guess #${guessCount}&lt;/strong&gt;
+  &lt;strong&gt;Guess number ${guessCount}&lt;/strong&gt;
 
   &lt;p&gt;Make a guess from the options below:&lt;/p&gt;
 
@@ -285,7 +285,7 @@ public class Guess
   }
 ]]></script>
 </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="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;strong&gt;Guess #${guessCount}&lt;/strong&gt;
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;strong&gt;Guess number ${guessCount}&lt;/strong&gt;
 
   &lt;t:if test=&quot;message&quot;&gt;
     &lt;p&gt;