Modified: websites/production/tapestry/content/templating-and-markup-faq.html
==============================================================================
--- websites/production/tapestry/content/templating-and-markup-faq.html 
(original)
+++ websites/production/tapestry/content/templating-and-markup-faq.html Sat Feb 
 3 18:21:36 2018
@@ -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>
+      SyntaxHighlighter.defaults['toolbar'] = false;
+      SyntaxHighlighter.all();
+    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -67,29 +77,52 @@
       </div>
 
       <div id="content">
-                <div 
id="ConfluenceContent"><plain-text-body>{scrollbar}</plain-text-body><h2 
id="TemplatingandMarkupFAQ-TemplatingandMarkup">Templating and 
Markup</h2><p>Main Article: <a  href="component-templates.html">Component 
Templates</a></p><h3 
id="TemplatingandMarkupFAQ-WhydoIgetaSAXParseExceptionwhenIuseanHTMLentity,suchas&amp;nbsp;inmytemplate?">Why
 do I get a SAXParseException when I use an HTML entity, such as 
<code>&amp;nbsp;</code> in my template?</h3><p>Tapestry uses a standard SAX 
parser to read your templates. This means that your templates must be <em>well 
formed</em>: open and close tags must balance, attribute values must be quoted, 
and entities must be declared. The easiest way to accomplish this is to add a 
DOCTYPE to your the top of your template:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">xml</parameter><plain-text-body>&lt;!DOCTYPE html PUBLIC 
"-//W3C//DTD XHTML 1.0 Strict//EN"
+                <div id="ConfluenceContent"><h2 
id="TemplatingandMarkupFAQ-TemplatingandMarkup">Templating and 
Markup</h2><p>Main Article: <a  
href="templating-and-markup-faq.html">Templating and Markup FAQ</a></p><h3 
id="TemplatingandMarkupFAQ-WhydoIgetaSAXParseExceptionwhenIuseanHTMLentity,suchas&amp;nbsp;inmytemplate?">Why
 do I get a SAXParseException when I use an HTML entity, such as 
<code>&amp;nbsp;</code> in my template?</h3><p>Tapestry uses a standard SAX 
parser to read your templates. This means that your templates must be <em>well 
formed</em>: open and close tags must balance, attribute values must be quoted, 
and entities must be declared. The easiest way to accomplish this is to add a 
DOCTYPE to your the top of your template:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
-</plain-text-body><p>Part of the DOCTYPE is the declaration of entities such 
as <code>&amp;nbsp;</code>.</p><p>Alternately, you can simply use the numeric 
version: <code>&amp;#160</code>; This is the exact same character and will 
render identically in the browser.</p><p>Starting in release 5.3, Tapestry 
introduces an XHTML doctype when no doctype is present; this means that common 
HTML entities will work correctly.</p><h3 
id="TemplatingandMarkupFAQ-Whydosomeimagesinmypageshowupasbrokenlinks?">Why do 
some images in my page show up as broken links?</h3><p>You have to be careful 
when using relative URLs inside page templates; the base URL may not always be 
what you expect. For example, inside your <code>ViewUser.tml</code> file, you 
may have:</p><parameter ac:name="controls">true</parameter><parameter 
ac:name="language">xml</parameter><plain-text-body>  &lt;img class="icon" 
src="icons/admin.png"/&gt;${user.name} has Administrative access
-</plain-text-body><p>This makes sense; ViewUser.tml is in the web context, as 
is the icons folder. The default URL for this page will be /viewuser (assuming 
that ViewUser class is in the &#160;<em>root-package</em>.pages 
package).</p><p>However, the ViewUser page might use a page activation context 
to identify which user is to be displayed:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">java</parameter><plain-text-body>public class ViewUser
+</pre>
+</div></div><p>Part of the DOCTYPE is the declaration of entities such as 
<code>&amp;nbsp;</code>.</p><p>Alternately, you can simply use the numeric 
version: <code>&amp;#160</code>; This is the exact same character and will 
render identically in the browser.</p><p>Starting in release 5.3, Tapestry 
introduces an XHTML doctype when no doctype is present; this means that common 
HTML entities will work correctly.</p><h3 
id="TemplatingandMarkupFAQ-Whydosomeimagesinmypageshowupasbrokenlinks?">Why do 
some images in my page show up as broken links?</h3><p>You have to be careful 
when using relative URLs inside page templates; the base URL may not always be 
what you expect. For example, inside your <code>ViewUser.tml</code> file, you 
may have:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">  &lt;img class="icon" 
src="icons/admin.png"/&gt;${user.name} has Administrative access
+</pre>
+</div></div><p>This makes sense; ViewUser.tml is in the web context, as is the 
icons folder. The default URL for this page will be /viewuser (assuming that 
ViewUser class is in the &#160;<em>root-package</em>.pages 
package).</p><p>However, the ViewUser page might use a page activation context 
to identify which user is to be displayed:</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 ViewUser
 
   @Property
   @PageActivationContext
   private User user;
 
   . . .
-</plain-text-body><p>With a page activation context, the URL for the page will 
incorporate the ID of the User object, something like 
<code>/viewuser/37371</code>. This is why the relative URL to the 
<code>admin.png</code> image is broken: the base path is relative to the page's 
URL, not to the page template. (In fact, the page template may not even be in 
the web context, it may be stored on the classpath, as component templates 
are.)</p><p>One solution would be to predict what the page URL will be, and 
adjust the path for that:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">xml</parameter><plain-text-body>  &lt;img class="icon" 
src="../icons/admin.png"/&gt;${user.name} has Administrative access
-</plain-text-body><p>But this has its own problems; the page activation 
context may vary in length at different times, or the template in question may 
be a component used across many different pages, making it difficult to predict 
what the correct relative URL would be.</p><p>The <em>best</em> solution for 
this situation, one that will be sure to work in all pages and all components, 
is to make use of the <code>context:</code> binding prefix:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">xml</parameter><plain-text-body>  &lt;img class="icon" 
src="${context:icons/admin.png}"/&gt;${user.name} has Administrative access
-</plain-text-body><p>The src attribute of the &lt;img&gt; tag will now be 
bound to a dynamically computed value: the location of the image file relative 
to the web application context. This is especially important for components 
that may be used on different pages.</p><h3 
id="TemplatingandMarkupFAQ-What'sthedifferencebetweenidandt:id?">What's the 
difference between <code>id</code> and <code>t:id</code>?</h3><p>You might 
occasionally see something like the following in a template:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">xml</parameter><plain-text-body>&lt;t:zone id="status" 
t:id="statusZone"&gt;
-</plain-text-body><p>Why two ids? Why are they different?</p><p>The 
<code>t:id</code> attribute is the Tapestry component id. This id is unique 
within its immediate container. This is the id you might use to inject the 
component into your page class:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">java</parameter><plain-text-body>  @InjectComponent
+</pre>
+</div></div><p>With a page activation context, the URL for the page will 
incorporate the ID of the User object, something like 
<code>/viewuser/37371</code>. This is why the relative URL to the 
<code>admin.png</code> image is broken: the base path is relative to the page's 
URL, not to the page template. (In fact, the page template may not even be in 
the web context, it may be stored on the classpath, as component templates 
are.)</p><p>One solution would be to predict what the page URL will be, and 
adjust the path for that:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">  &lt;img class="icon" 
src="../icons/admin.png"/&gt;${user.name} has Administrative access
+</pre>
+</div></div><p>But this has its own problems; the page activation context may 
vary in length at different times, or the template in question may be a 
component used across many different pages, making it difficult to predict what 
the correct relative URL would be.</p><p>The <em>best</em> solution for this 
situation, one that will be sure to work in all pages and all components, is to 
make use of the <code>context:</code> binding prefix:</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">  &lt;img class="icon" 
src="${context:icons/admin.png}"/&gt;${user.name} has Administrative access
+</pre>
+</div></div><p>The src attribute of the &lt;img&gt; tag will now be bound to a 
dynamically computed value: the location of the image file relative to the web 
application context. This is especially important for components that may be 
used on different pages.</p><h3 
id="TemplatingandMarkupFAQ-What'sthedifferencebetweenidandt:id?">What's the 
difference between <code>id</code> and <code>t:id</code>?</h3><p>You might 
occasionally see something like the following in a template:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;t:zone id="status" t:id="statusZone"&gt;
+</pre>
+</div></div><p>Why two ids? Why are they different?</p><p>The 
<code>t:id</code> attribute is the Tapestry component id. This id is unique 
within its immediate container. This is the id you might use to inject the 
component into your page class:</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;">  @InjectComponent
   private Zone statusZone;
-</plain-text-body><p>The other id is the client id, a unique id for the 
rendered element within the client-side DOM. JavaScript that needs to access 
the element uses this id. For example:</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">text</parameter><plain-text-body>  $('status').hide();
-</plain-text-body><p>In many components, the <code>id</code> attribute is an 
informal parameter; a value from the template that is blindly echoed into the 
output document. In other cases, the component itself has an <code>id</code> 
attribute. Often, in the latter case, the Tapestry component id is the 
<em>default</em> value for the client id.</p><h3 
id="TemplatingandMarkupFAQ-WhydomyimagesandstylesheetsendupwithaweirdURLslike/assets/meta/zeea17aee26bc0cae/layout/layout.css?">Why
 do my images and stylesheets end up with a weird URLs like 
<code>/assets/meta/zeea17aee26bc0cae/layout/layout.css</code>?</h3><p>Tapestry 
doesn't rely on the servlet container to serve up your static assets (images, 
stylesheets, flash movies, etc.). Instead, Tapestry processes the requests 
itself, streaming assets to the browser.</p><p>Asset content will be GZIP 
compressed (if the client supports compression, and the content is 
compressible). In addition, Tapestry will set a far-future expires header on 
the 
 content. This means that the browser will not ask for the file again, greatly 
reducing network traffic.</p><p>The weird hex string is 
a&#160;<em>fingerprint</em>; it is a hash code computed from the actual content 
of the asset. If the asset ever changes, it will have a new fingerprint, and so 
will be a new path and a new (immutable) resource. This approach, combined with 
a far-future expires header also provided by Tapestry, ensures that clients 
aggressively cache assets as they navigate your site, or even between 
visits.</p><p><span style="color: rgb(83,145,38);font-size: 16.0px;line-height: 
1.5625;">How do I add a CSS class to a Tapestry component?</span></p><p>As they 
say, "just do it". The majority of Tapestry components support <em>informal 
parameters</em>, meaning that any extra attributes in the element (in the 
template) will be rendered out as additional attributes. So, you can apply a 
CSS class or style quite easily:</p><parameter 
ac:name="controls">true</parameter><paramet
 er ac:name="language">xml</parameter><plain-text-body>  &lt;t:textfield 
t:id="username" class="big-green"/&gt;
-</plain-text-body><p>You can even use template expansions inside the attribute 
value:</p><parameter ac:name="controls">true</parameter><parameter 
ac:name="language">xml</parameter><plain-text-body>  &lt;t:textfield 
t:id="username" class="${usernameClass}"/&gt;
-</plain-text-body><p>and</p><parameter 
ac:name="controls">true</parameter><parameter 
ac:name="language">java</parameter><plain-text-body>  public String 
getUsernameClass() 
+</pre>
+</div></div><p>The other id is the client id, a unique id for the rendered 
element within the client-side DOM. JavaScript that needs to access the element 
uses this id. For example:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: text; gutter: false; theme: Default" 
style="font-size:12px;">  $('status').hide();
+</pre>
+</div></div><p>In many components, the <code>id</code> attribute is an 
informal parameter; a value from the template that is blindly echoed into the 
output document. In other cases, the component itself has an <code>id</code> 
attribute. Often, in the latter case, the Tapestry component id is the 
<em>default</em> value for the client id.</p><h3 
id="TemplatingandMarkupFAQ-WhydomyimagesandstylesheetsendupwithaweirdURLslike/assets/meta/zeea17aee26bc0cae/layout/layout.css?">Why
 do my images and stylesheets end up with a weird URLs like 
<code>/assets/meta/zeea17aee26bc0cae/layout/layout.css</code>?</h3><p>Tapestry 
doesn't rely on the servlet container to serve up your static assets (images, 
stylesheets, flash movies, etc.). Instead, Tapestry processes the requests 
itself, streaming assets to the browser.</p><p>Asset content will be GZIP 
compressed (if the client supports compression, and the content is 
compressible). In addition, Tapestry will set a far-future expires header on 
the conten
 t. This means that the browser will not ask for the file again, greatly 
reducing network traffic.</p><p>The weird hex string is 
a&#160;<em>fingerprint</em>; it is a hash code computed from the actual content 
of the asset. If the asset ever changes, it will have a new fingerprint, and so 
will be a new path and a new (immutable) resource. This approach, combined with 
a far-future expires header also provided by Tapestry, ensures that clients 
aggressively cache assets as they navigate your site, or even between 
visits.</p><p><span style="color: rgb(83,145,38);">How do I add a CSS class to 
a Tapestry component?</span></p><p>As they say, "just do it". The majority of 
Tapestry components support <em>informal parameters</em>, meaning that any 
extra attributes in the element (in the template) will be rendered out as 
additional attributes. So, you can apply a CSS class or style quite 
easily:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">  &lt;t:textfield t:id="username" class="big-green"/&gt;
+</pre>
+</div></div><p>You can even use template expansions inside the attribute 
value:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">  &lt;t:textfield t:id="username" 
class="${usernameClass}"/&gt;
+</pre>
+</div></div><p>and</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 String getUsernameClass() 
   {
     return isUrgent() ? "urgent" : null;
   }
-</plain-text-body><p>When an informal parameter is bound to null, then the 
attribute is not written out at all.</p><p>You can verify which components 
support informal parameters by checking the component reference, or looking for 
the @<a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html";>SupportsInformalParameters</a>
 annotation in the components' source 
file.</p><plain-text-body>{scrollbar}</plain-text-body><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p></div>
+</pre>
+</div></div><p>When an informal parameter is bound to null, then the attribute 
is not written out at all.</p><p>You can verify which components support 
informal parameters by checking the component reference, or looking for the @<a 
 class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html";>SupportsInformalParameters</a>
 annotation in the components' source 
file.&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p></p><div
 class="display-footnotes" 
data-footnotestodisplay="${footnotesToDisplay}"></div>
+<p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p></div>
       </div>
 
       <div class="clearer"></div>

Modified: websites/production/tapestry/content/the-tapestry-jail.html
==============================================================================
--- websites/production/tapestry/content/the-tapestry-jail.html (original)
+++ websites/production/tapestry/content/the-tapestry-jail.html Sat Feb  3 
18:21:36 2018
@@ -44,13 +44,26 @@
 
   <div class="wrapper bs">
 
-        <div id="navigation"><div class="nav"><ul class="alternate"><li><a  
href="index.html">Home</a></li><li><a  href="getting-started.html">Getting 
Started</a></li><li><a  href="documentation.html">Documentation</a></li><li><a  
href="download.html">Download</a></li><li><a  
href="about.html">About</a></li><li><a  class="external-link" 
href="http://www.apache.org/licenses/LICENSE-2.0";>License</a></li><li><a  
href="community.html">Community</a></li><li><a  class="external-link" 
href="http://www.apache.org/security/";>Security</a></li><li><a  
class="external-link" href="http://www.apache.org/";>Apache</a></li><li><a  
class="external-link" 
href="http://www.apache.org/foundation/sponsorship.html";>Sponsorship</a></li><li><a
  class="external-link" 
href="http://www.apache.org/foundation/thanks.html";>Thanks</a></li></ul></div></div>
+        <div id="navigation"><div class="nav"><ul class="alternate"><li><a  
href="index.html">Home</a></li><li><a  href="getting-started.html">Getting 
Started</a></li><li><a  href="documentation.html">Documentation</a></li><li><a  
href="download.html">Download</a></li><li><a  
href="about.html">About</a></li><li><a  class="external-link" 
href="http://www.apache.org/licenses/LICENSE-2.0";>License</a></li><li><a  
href="community.html">Community</a></li><li><a  class="external-link" 
href="http://www.apache.org/security/";>Security</a></li><li><a  
class="external-link" href="http://www.apache.org/";>Apache</a></li><li><a  
class="external-link" 
href="http://www.apache.org/foundation/sponsorship.html";>Sponsorship</a></li><li><a
  class="external-link" 
href="http://www.apache.org/foundation/thanks.html";>Thanks</a></li></ul></div>
+
+</div>
 
           <div id="top">
-            <div id="smallbanner"><div class="searchbox" 
style="float:right;margin: .3em 1em .1em 1em"><span style="color: #999; 
font-size: 90%">Tapestry docs, issues, wikis &amp; blogs:</span><form 
enctype="application/x-www-form-urlencoded" method="get" 
action="http://tapestry.apache.org/search.html";> 
- <input type="text" name="q"> 
- <input type="submit" value="Search"> 
-</form></div><div class="emblem" style="float:left"><p><a  
href="index.html"><span class="confluence-embedded-file-wrapper"><img 
class="confluence-embedded-image confluence-external-resource" 
src="http://tapestry.apache.org/images/tapestry_small.png"; 
data-image-src="http://tapestry.apache.org/images/tapestry_small.png";></span></a></p></div><div
 class="title" style="float:left; margin: 0 0 0 3em"><h1 
id="SmallBanner-PageTitle">The tapestry jail</h1></div></div>
+            <div id="smallbanner"><div class="searchbox" 
style="float:right;margin: .3em 1em .1em 1em"><span style="color: #999; 
font-size: 90%">Tapestry docs, issues, wikis &amp; blogs:</span>
+<form enctype="application/x-www-form-urlencoded" method="get" 
action="http://tapestry.apache.org/search.html";>
+  <input type="text" name="q">
+  <input type="submit" value="Search">
+</form>
+
+</div>
+
+
+<div class="emblem" style="float:left"><p><a  href="index.html"><span 
class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image 
confluence-external-resource" 
src="http://tapestry.apache.org/images/tapestry_small.png"; 
data-image-src="http://tapestry.apache.org/images/tapestry_small.png";></span></a></p></div>
+
+
+<div class="title" style="float:left; margin: 0 0 0 3em"><h1 
id="SmallBanner-PageTitle">The tapestry jail</h1></div>
+
+</div>
       <div class="clearer"></div>
       </div>
 
@@ -62,7 +75,7 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent"><p>We've got a jail at 
tapestry.zones.apache.org running Tomcat 7 where we can deploy demo 
applications. The Hotel Booking demo is running there.</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>The jail has been replaced by an 
Ubuntu VM, tapestry-vm.apache.org, where the Hotel Booking app has been moved. 
This document needs to be updated to reflect the new 
server.</p></div></div><p>&#160;</p><p>&#160;</p><p>ccordenier and uli can 
deploy and manage webapps. ccordenier, thiagohp and uli can log in and restart 
Tomcat.</p><h4 id="Thetapestryjail-restartingtomcat">restarting 
tomcat</h4><p><strong>ONLY</strong> use</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+                <div id="ConfluenceContent"><p>We've got a jail at <a  
class="external-link" 
href="http://tapestry.zones.apache.org";>tapestry.zones.apache.org</a> running 
Tomcat 7 where we can deploy demo applications. The Hotel Booking demo is 
running there.</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>The jail has been replaced by an 
Ubuntu VM, <a  class="external-link" 
href="http://tapestry-vm.apache.org";>tapestry-vm.apache.org</a>, where the 
Hotel Booking app has been moved. This document needs to be updated to reflect 
the new server.</p></div></div><p>&#160;</p><p>&#160;</p><p>ccordenier and uli 
can deploy and manage webapps. ccordenier, thiagohp and uli can log in and 
restart Tomcat.</p><h4 id="Thetapestryjail-restartingtomcat">restarting 
tomcat</h4><p><strong>ONLY</strong> use</p><div class="cod
 e panel pdl" style="border-width: 1px;"><div class="codeContent panelContent 
pdl">
 <pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">sudo /usr/local/etc/rc.d/tomcat7 restart
 </pre>
 </div></div><p>if you need to restart Tomcat. Anything else will fail.</p><h4 
id="Thetapestryjail-reinstallingthejail">reinstalling the jail</h4><p>If the 
jail lost Java and Tomcat:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
@@ -79,7 +92,7 @@ make install clean
 </div></div><p>Some files need manual download and have to be placed into 
<code>/usr/ports/distfiles</code>. Follow the instructions on 
screen.</p><p>Some of these files already live on <a  class="external-link" 
href="ftp://tb.apache.org/pub/FreeBSD/ports/distfiles/"; 
rel="nofollow">ftp://tb.apache.org/pub/FreeBSD/ports/distfiles/</a> and can be 
downloaded from there. The time zone update utility doesn't, it has to be 
downloaded from Oracle directly.</p><p>Afterwards:</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;">make install clean
 </pre>
-</div></div><p>Follow instructions and manually install any unresolved 
dependencies it might encounter.</p><h4 
id="Thetapestryjail-InstallTomcat7:">Install Tomcat 7:</h4><h5 
id="Thetapestryjail-frompre-builtpackage(preferred)">from pre-built package 
(preferred)</h5><p>Check your env for PACKAGESITE. It should point to 
tb.apache.org:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+</div></div><p>Follow instructions and manually install any unresolved 
dependencies it might encounter.</p><h4 
id="Thetapestryjail-InstallTomcat7:">Install Tomcat 7:</h4><h5 
id="Thetapestryjail-frompre-builtpackage(preferred)">from pre-built package 
(preferred)</h5><p>Check your env for PACKAGESITE. It should point to <a  
class="external-link" href="http://tb.apache.org";>tb.apache.org</a>:</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;">[root@tapestry ~]# env|grep PACKAGESITE
 
PACKAGESITE=ftp://tb.apache.org/pub/FreeBSD/ports/packages/8.2-RELENG-j-tlp/Latest/
 </pre>

Modified: websites/production/tapestry/content/using-select-with-a-list.html
==============================================================================
--- websites/production/tapestry/content/using-select-with-a-list.html 
(original)
+++ websites/production/tapestry/content/using-select-with-a-list.html Sat Feb  
3 18:21:36 2018
@@ -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>
+      SyntaxHighlighter.defaults['toolbar'] = false;
+      SyntaxHighlighter.all();
+    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -67,13 +77,15 @@
       </div>
 
       <div id="content">
-                <div 
id="ConfluenceContent"><plain-text-body>{scrollbar}</plain-text-body><parameter 
ac:name="hidden">true</parameter><parameter 
ac:name="atlassian-macro-output-type">BLOCK</parameter><rich-text-body><p>Using 
SelectModel, SelectModelFactory and ValueEncoder for Select menus populated 
from a database</p></rich-text-body><h1 
id="UsingSelectWithaList-UsingSelectWithaList">Using Select With a 
List</h1><p>The documentation for the <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html";>Select
 Component</a> and the <a  href="tutorial.html">Tapestry Tutorial</a> provide 
simplistic examples of populating a drop-down menu (as the (X)HTML 
<em>Select</em> element) using comma-delimited strings and enums. However, most 
real-world Tapestry applications need to populate such menus using values from 
a database, commonly in the form of java.util.List objects. Doing so generally 
requires a <a  class="external-lin
 k" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SelectModel.html";>SelectModel</a>
 and a <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValueEncoder.html";>ValueEncoder</a>
 bound to the Select component with its "model" and "encoder" 
parameters:</p><plain-text-body>&lt;t:select t:id="colorMenu" 
value="selectedColor" model="ColorSelectModel" encoder="colorEncoder" /&gt;
-</plain-text-body><p>In the above example, ColorSelectModel must be of type 
SelectModel, or anything that Tapestry knows how to <a  
href="parameter-type-coercion.html">coerce</a> into a SelectModel, such as a 
List or a Map or a "value=label,value=label,..." delimited string, or anything 
Tapestry knows how to coerce into a List or Map, such as an Array or a 
comma-delimited String.</p><h2 
id="UsingSelectWithaList-SelectModel">SelectModel</h2><plain-text-body>{float:right|background=#eee|padding=0
 1em}
-    *JumpStart Demos:*
-    [Total Control Object 
Select|http://jumpstart.doublenegative.com.au/jumpstart/examples/select/totalcontrolobject]
-    [ID 
Select|http://jumpstart.doublenegative.com.au/jumpstart/examples/select/id]
-    [Easy ID 
Select|http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyid]
-{float}</plain-text-body><p>A SelectModel is a collection of options 
(specifically <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/OptionModel.html";>OptionModel</a>
 objects) for a drop-down menu. Basically, each option is a value (an object) 
and a label (presented to the user).</p><p>If you provide a property of type 
List for the "model" parameter, Tapestry automatically builds a SelectModel 
that uses each object's toString() for both the select option value and the 
select option label. For database-derrived lists this is rarely useful, 
however, since after form submission you would then have to look up the 
selected object using that label.</p><p>If you provide a Map, Tapestry builds a 
SelectModel that uses each item's key as the encoded value and its value as the 
user-visible label. This is more useful, but if you are going to build a copy 
of the list as a map just for this purpose, you may as well let Tapestry do it 
for you, using Se
 lectModelFactory.</p><h2 
id="UsingSelectWithaList-SelectModelFactory">SelectModelFactory</h2><p>To have 
Tapestry create a SelectModel for you, use the <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/SelectModelFactory.html";>SelectModelFactory</a>
 service. SelectModelFactory creates a SelectModel from a List of objects (of 
whatever type) and a label property name that you choose:</p><parameter 
ac:name="title">SelectWithListDemo.java (a page 
class)</parameter><plain-text-body>@Property
+                <div id="ConfluenceContent"><h1 
id="UsingSelectWithaList-UsingSelectWithaList">Using Select With a 
List</h1><p>The documentation for the <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html";>Select
 Component</a> and the <a  href="using-select-with-a-list.html">Tapestry 
Tutorial</a> provide simplistic examples of populating a drop-down menu (as the 
(X)HTML <em>Select</em> element) using comma-delimited strings and enums. 
However, most real-world Tapestry applications need to populate such menus 
using values from a database, commonly in the form of java.util.List objects. 
Doing so generally requires a <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SelectModel.html";>SelectModel</a>
 and a <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValueEncoder.html";>ValueEncoder</a>
 bound to the Select component wi
 th its "model" and "encoder" 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;">&lt;t:select t:id="colorMenu" value="selectedColor" 
model="ColorSelectModel" encoder="colorEncoder" /&gt;
+</pre>
+</div></div><p>In the above example, ColorSelectModel must be of type 
SelectModel, or anything that Tapestry knows how to <a  
href="using-select-with-a-list.html">coerce</a> into a SelectModel, such as a 
List or a Map or a "value=label,value=label,..." delimited string, or anything 
Tapestry knows how to coerce into a List or Map, such as an Array or a 
comma-delimited String.</p><h2 
id="UsingSelectWithaList-SelectModel">SelectModel</h2><p></p><div 
class="navmenu" style="float:right; background:#eee; margin:3px; padding:0 1em">
+<p>    <strong>JumpStart Demos:</strong><br clear="none">
+    <a  class="external-link" 
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/select/totalcontrolobject";
 rel="nofollow">Total Control Object Select</a><br clear="none">
+    <a  class="external-link" 
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/select/id"; 
rel="nofollow">ID Select</a><br clear="none">
+    <a  class="external-link" 
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyid"; 
rel="nofollow">Easy ID Select</a></p></div>A SelectModel is a collection of 
options (specifically <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/OptionModel.html";>OptionModel</a>
 objects) for a drop-down menu. Basically, each option is a value (an object) 
and a label (presented to the user).<p>If you provide a property of type List 
for the "model" parameter, Tapestry automatically builds a SelectModel that 
uses each object's toString() for both the select option value and the select 
option label. For database-derrived lists this is rarely useful, however, since 
after form submission you would then have to look up the selected object using 
that label.</p><p>If you provide a Map, Tapestry builds a SelectModel that uses 
each item's key as the encoded value and its value as the user-visible label. 
This is more useful, but if you ar
 e going to build a copy of the list as a map just for this purpose, you may as 
well let Tapestry do it for you, using SelectModelFactory.</p><h2 
id="UsingSelectWithaList-SelectModelFactory">SelectModelFactory</h2><p>To have 
Tapestry create a SelectModel for you, use the <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/SelectModelFactory.html";>SelectModelFactory</a>
 service. SelectModelFactory creates a SelectModel from a List of objects (of 
whatever type) and a label property name that you choose:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>SelectWithListDemo.java (a page 
class)</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Property
 private SelectModel colorSelectModel;
 @Inject
 SelectModelFactory selectModelFactory;
@@ -85,15 +97,18 @@ void setupRender() {
     // create a SelectModel from my list of colors
     colorSelectModel = selectModelFactory.create(colors, "name");
 }
-</plain-text-body><p>The resulting SelectModel has a selectable option 
(specifically, an OptionModel) for every object in the original List. The label 
property name (the "name" property, in this example) determines the 
user-visible text of each menu option, and your ValueEncoder's toClient() 
method provides the encoded value (most commonly a simple number). If you don't 
provide a ValueEncoder, the result of the objects' toString() method 
(Color#toString() in this example) is used. Although not a recommended 
practice, you <em>could</em> set your toString() to return the object's ID for 
this purpose:</p><parameter ac:name="title">Color.java 
(partial)</parameter><plain-text-body>...
+</pre>
+</div></div><p>The resulting SelectModel has a selectable option 
(specifically, an OptionModel) for every object in the original List. The label 
property name (the "name" property, in this example) determines the 
user-visible text of each menu option, and your ValueEncoder's toClient() 
method provides the encoded value (most commonly a simple number). If you don't 
provide a ValueEncoder, the result of the objects' toString() method 
(Color#toString() in this example) is used. Although not a recommended 
practice, you <em>could</em> set your toString() to return the object's ID for 
this purpose:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Color.java (partial)</b></div><div class="codeContent panelContent 
pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">...
 @Override
 public String toString() {
     return String.valueOf(this.getId()); 
 }
-</plain-text-body><p>But that is contorting the purpose of the toString() 
method, and if you go to that much trouble you're already half way to the 
recommended practice: creating a ValueEncoder.</p><h2 
id="UsingSelectWithaList-ValueEncoder">ValueEncoder</h2><p>In addition to a 
SelectModel, your Select menu is likely to need a ValueEncoder. While a 
SelectModel is concerned only with how to construct a Select menu, a 
ValueEncoder is used when constructing the Select menu <em>and</em> when 
interpreting the encoded value that is submitted back to the server. A 
ValueEncoder is a converter between the type of objects you want to represent 
as options in the menu and the client-side encoded values that uniquely 
identify them, and 
vice-versa.</p><plain-text-body>{float:right|background=#eee|padding=0 1em}
-    *JumpStart Demo:*
-    [Easy Object 
Select|http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject]
-{float}</plain-text-body><p>Most commonly, your ValueEncoder's toClient() 
method will return a unique ID (e.g. a database primary key, or perhaps a UUID) 
of the given object, and its toValue() method will return the <em>object</em> 
matching the given ID by doing a database lookup (ideally using a service or 
DAO method).</p><p>If you're using one of the ORM integration modules (<a  
href="hibernate.html">Tapestry-Hibernate</a>, <a  
href="integrating-with-jpa.html">Tapestry-JPA</a>, or <a  class="external-link" 
href="http://code.google.com/p/tapestry5-cayenne/wiki/ValueEncoder"; 
rel="nofollow">Tapestry-Cayenne</a>), the ValueEncoder is automatically 
provided for each of your mapped entity classes. The Hibernate module's 
implementation is typical: the primary key field of the object (converted to a 
String) is used as the client-side value, and that same primary key is used to 
look up the selected object.</p><p>That's exactly what you should do in your 
own ValueEncoders too:</p><parameter
  ac:name="title">ColorEncoder.java (perhaps in your 
com.example.myappname.encoders package)</parameter><plain-text-body>public 
class ColorEncoder implements ValueEncoder&lt;Color&gt;, 
ValueEncoderFactory&lt;Color&gt; { 
+</pre>
+</div></div><p>But that is contorting the purpose of the toString() method, 
and if you go to that much trouble you're already half way to the recommended 
practice: creating a ValueEncoder.</p><h2 
id="UsingSelectWithaList-ValueEncoder">ValueEncoder</h2><p>In addition to a 
SelectModel, your Select menu is likely to need a ValueEncoder. While a 
SelectModel is concerned only with how to construct a Select menu, a 
ValueEncoder is used when constructing the Select menu <em>and</em> when 
interpreting the encoded value that is submitted back to the server. A 
ValueEncoder is a converter between the type of objects you want to represent 
as options in the menu and the client-side encoded values that uniquely 
identify them, and vice-versa.</p><div class="navmenu" style="float:right; 
background:#eee; margin:3px; padding:0 1em">
+<p>    <strong>JumpStart Demo:</strong><br clear="none">
+    <a  class="external-link" 
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject";
 rel="nofollow">Easy Object Select</a></p></div>Most commonly, your 
ValueEncoder's toClient() method will return a unique ID (e.g. a database 
primary key, or perhaps a UUID) of the given object, and its toValue() method 
will return the <em>object</em> matching the given ID by doing a database 
lookup (ideally using a service or DAO method).<p>If you're using one of the 
ORM integration modules (<a  
href="using-select-with-a-list.html">Tapestry-Hibernate</a>, <a  
href="using-select-with-a-list.html">Tapestry-JPA</a>, or <a  
class="external-link" 
href="http://code.google.com/p/tapestry5-cayenne/wiki/ValueEncoder"; 
rel="nofollow">Tapestry-Cayenne</a>), the ValueEncoder is automatically 
provided for each of your mapped entity classes. The Hibernate module's 
implementation is typical: the primary key field of the object (converted to a 
String) is used as the client-side value, and
  that same primary key is used to look up the selected object.</p><p>That's 
exactly what you should do in your own ValueEncoders too:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>ColorEncoder.java (perhaps in your 
com.example.myappname.encoders package)</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">public class ColorEncoder implements 
ValueEncoder&lt;Color&gt;, ValueEncoderFactory&lt;Color&gt; { 
 
     @Inject
     private ColorService colorService;
@@ -116,7 +131,9 @@ public String toString() {
         return this; 
     }
 } 
-</plain-text-body><p>Alternatively, if you don't expect to need a particular 
ValueEncoder more than once in your app, you might want to just create it on 
demand, using an anonymous inner class, from the getter method in the component 
class where it is needed. For example:</p><parameter 
ac:name="title">SelectWithListDemo.java (a page class, 
partial)</parameter><plain-text-body>    . . .
+</pre>
+</div></div><p>Alternatively, if you don't expect to need a particular 
ValueEncoder more than once in your app, you might want to just create it on 
demand, using an anonymous inner class, from the getter method in the component 
class where it is needed. For example:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>SelectWithListDemo.java (a page class, 
partial)</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">    . . .
 
     public ValueEncoder&lt;Color&gt; getColorEncoder() {
 
@@ -135,26 +152,35 @@ public String toString() {
             }
         }; 
     }
-</plain-text-body><p>Notice that the body of this anonymous inner class is the 
same as the body of the ColorEncoder top level class, except that we don't need 
a <code>create</code> method.</p><h2 
id="UsingSelectWithaList-ApplyingyourValueEncoderAutomatically">Applying your 
ValueEncoder Automatically</h2><p>If your ValueEncoder <em>implements 
ValueEncoderFactory</em> (as the ColorEncoder top level class does, above), you 
can associate your custom ValueEncoder with your entity class so that Tapestry 
will automatically use it every time a ValueEncoder is needed for items of that 
type (such as with the Select, RadioGroup, Grid, Hidden and AjaxFormLoop 
components). Just add lines like the following to your module class (usually 
AppModule.java):</p><parameter ac:name="title">AppModule.java 
(partial)</parameter><plain-text-body>...
+</pre>
+</div></div><p>Notice that the body of this anonymous inner class is the same 
as the body of the ColorEncoder top level class, except that we don't need a 
<code>create</code> method.</p><h2 
id="UsingSelectWithaList-ApplyingyourValueEncoderAutomatically">Applying your 
ValueEncoder Automatically</h2><p>If your ValueEncoder <em>implements 
ValueEncoderFactory</em> (as the ColorEncoder top level class does, above), you 
can associate your custom ValueEncoder with your entity class so that Tapestry 
will automatically use it every time a ValueEncoder is needed for items of that 
type (such as with the Select, RadioGroup, Grid, Hidden and AjaxFormLoop 
components). Just add lines like the following to your module class (usually 
AppModule.java):</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>AppModule.java (partial)</b></div><div class="codeContent panelContent 
pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">...
     public static void 
contributeValueEncoderSource(MappedConfiguration&lt;Class&lt;Color&gt;,
                         ValueEncoderFactory&lt;Color&gt;&gt; configuration) { 
         configuration.addInstance(Color.class, ColorEncoder.class);
     }
-</plain-text-body><p>If you are contributing more than one ValueEncoder, 
you'll have to use raw types, like this:</p><parameter 
ac:name="title">AppModule.java (partial)</parameter><plain-text-body>...
+</pre>
+</div></div><p>If you are contributing more than one ValueEncoder, you'll have 
to use raw types, like this:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>AppModule.java (partial)</b></div><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">...
     public static void 
contributeValueEncoderSource(MappedConfiguration&lt;Class,
                         ValueEncoderFactory&gt; configuration)
     {
         configuration.addInstance(Color.class, ColorEncoder.class);
         configuration.addInstance(SomeOtherType.class, 
SomeOtherTypeEncoder.class);
     }
-</plain-text-body><h2 
id="UsingSelectWithaList-WhatifIomittheValueEncoder?">What if I omit the 
ValueEncoder?</h2><p>The Select component's "encoder" parameter is optional, 
but if the "value" parameter is bound to a complex object (not a simple String, 
Integer, etc.) and you don't provide a ValueEncoder with the "encoder" 
parameter (and one isn't provided automatically by, for example, the Tapestry 
Hibernate integration), you'll receive a "Could not find a coercion" exception 
(when you submit the form) as Tapestry tries to convert the selected option's 
encoded value back to the <em>object</em> in your Select's "value" parameter. 
To fix this, you'll either have to 1) provide a ValueEncoder, 2) provide a <a  
href="type-coercion.html">Coercion</a>, or 3) use a simple value (String, 
Integer, etc.) for your Select's "value" parameter, and then you'll have to add 
logic in the corresponding onSuccess event listener method:</p><parameter 
ac:name="title">SelectWithListDemo.tml (partial)</para
 meter><plain-text-body>&lt;t:select t:id="colorMenu" value="selectedColorId" 
model="ColorSelectModel" /&gt;
-</plain-text-body><parameter ac:name="title">SelectWithListDemo.java 
(partial)</parameter><plain-text-body>...
+</pre>
+</div></div><h2 id="UsingSelectWithaList-WhatifIomittheValueEncoder?">What if 
I omit the ValueEncoder?</h2><p>The Select component's "encoder" parameter is 
optional, but if the "value" parameter is bound to a complex object (not a 
simple String, Integer, etc.) and you don't provide a ValueEncoder with the 
"encoder" parameter (and one isn't provided automatically by, for example, the 
Tapestry Hibernate integration), you'll receive a "Could not find a coercion" 
exception (when you submit the form) as Tapestry tries to convert the selected 
option's encoded value back to the <em>object</em> in your Select's "value" 
parameter. To fix this, you'll either have to 1) provide a ValueEncoder, 2) 
provide a <a  href="using-select-with-a-list.html">Coercion</a>, or 3) use a 
simple value (String, Integer, etc.) for your Select's "value" parameter, and 
then you'll have to add logic in the corresponding onSuccess event listener 
method:</p><div class="code panel pdl" style="border-width: 1px;"><div 
 class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>SelectWithListDemo.tml (partial)</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">&lt;t:select t:id="colorMenu" value="selectedColorId" 
model="ColorSelectModel" /&gt;
+</pre>
+</div></div><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>SelectWithListDemo.java (partial)</b></div><div class="codeContent 
panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">...
     public void onSuccessFromMyForm() {
         // look up the color object from the ID selected
        selectedColor = colorService.findById(selectedColorId);
        ...
     }
-</plain-text-body><p>But then again, you may as well create a ValueEncoder 
instead.</p><h2 id="UsingSelectWithaList-Whyisthissohard?">Why is this so 
hard?</h2><p>Actually, it's really pretty easy if you follow the examples 
above. But why is Tapestry designed to use SelectModels and ValueEncoders 
anyway? Well, in short, this design allows you to avoid storing (via @Persist, 
@SessionAttribute or @SessionState) the entire (potentially large) list of 
objects in the session or rebuilding the whole list of objects again (though 
only one is needed) when the form is submitted. The chief benefits are reduced 
memory use and <a  href="performance-and-clustering.html">more scalable 
clustering</a> due to having far less HTTP session data to replicate across the 
nodes of a cluster.</p></div>
+</pre>
+</div></div><p>But then again, you may as well create a ValueEncoder 
instead.</p><h2 id="UsingSelectWithaList-Whyisthissohard?">Why is this so 
hard?</h2><p>Actually, it's really pretty easy if you follow the examples 
above. But why is Tapestry designed to use SelectModels and ValueEncoders 
anyway? Well, in short, this design allows you to avoid storing (via @Persist, 
@SessionAttribute or @SessionState) the entire (potentially large) list of 
objects in the session or rebuilding the whole list of objects again (though 
only one is needed) when the form is submitted. The chief benefits are reduced 
memory use and <a  href="using-select-with-a-list.html">more scalable 
clustering</a> due to having far less HTTP session data to replicate across the 
nodes of a cluster.</p></div>
       </div>
 
       <div class="clearer"></div>

Modified: websites/production/tapestry/content/version-numbers.html
==============================================================================
--- websites/production/tapestry/content/version-numbers.html (original)
+++ websites/production/tapestry/content/version-numbers.html Sat Feb  3 
18:21:36 2018
@@ -67,59 +67,13 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent">
+                <div id="ConfluenceContent"><p>
 
-<div class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Added in 
5.3</p><span class="aui-icon aui-icon-small aui-iconfont-info 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body">
+</p><div class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Added in 
5.3</p><span class="aui-icon aui-icon-small aui-iconfont-info 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body">
 </div></div>
 <div class="error"><span class="error">Unknown macro: {div}</span> 
-
 <p>Tapestry version numbering was change starting in release 5.3.  Tapestry 
5.2 and earlier used a different numbering scheme whose primary failing was 
that, from the version number, it was not obvious what the <em>stability</em> 
of the version was.</p>
-</div>
-
-<p>This document describes Tapestry's version numbering system. This is 
important, as version numbers relate both to artifacts available for download, 
or from a Maven repository, and also to bugs recorded in the issue tracking 
system.</p>
-
-<h1 id="VersionNumbers-TapestryReleaseNumbers">Tapestry Release Numbers</h1>
-
-<p>Tapestry release numbers consist of a product version number, and release 
index number, seperated by periods, for example "5.3".  The product version 
number, 5, is unlikely to change any time soon (it would indicate a 
non-backwards compatible rewrite of the framework, and we've had enough of 
that, thank you very much). </p>
-
-<h1 id="VersionNumbers-TapestryStableReleaseVersions">Tapestry Stable Release 
Versions</h1>
-
-<p>Tapestry stable releases use the name version number as the release 
number.</p>
-
-<p>A bug fix release follows a stable release, when necessary. Bug fix 
releases add a sequence number to the product release number. Thus, the first 
bug fix release for Tapestry 5.3 will be version 5.3.1, then 5.3.2, as 
necessary.</p>
-
-<p>A bug fix release <em>replaces</em> the previous stable release. </p>
-
-<h1 id="VersionNumbers-PreviewVersions">Preview Versions</h1>
-
-<p>During the course of development of a release, there will be preview 
releases of non-final versions.  A preview version consists of the product 
version, a stability term, and an index number, separated by dashes. The 
stability term is "alpha", "beta", or "rc".</p>
-
-<p>The index number starts at 1.  A preview version number might be 
"5.3-alpha-2", or "5.3-beta-1", for example. The index number resets back to 
one when the stability itself is upgraded.</p>
-
-<p>"alpha" versions are not stable; the represent functionality in flux; 
classes and methods may be renamed or otherwise refactored between releases.</p>
-
-<p>"beta" versions occur once main functionality is complete; they exist to 
fix bugs in both old and new functionality, and fill any gaps in 
functionality.</p>
-
-<p>"rc" versions are "release candidates"; the functionality should be solid; 
the point of a release candidate is to get wide exposure to the new codebase to 
ensure that the final release is free of bugs.</p>
-
-<h1 id="VersionNumbers-PreviewPackages">Preview Packages</h1>
-
-<p>A preview package may be created at any time. A tag is created in Git to 
label the exact source from which the preview package is generated.  The 
preview package is built and uploaded to the Apache Nexus. Once uploaded, the 
master version number (in trunk) should be advanced to the next index number 
within the same stability series (example: "5.3-alpha-2" to "5.3-alpha-3").</p>
-
-<p>The Apache Nexus URL for the preview package may be distributed on the 
Tapestry user mailing list. However, preview packages are deleted, not 
released. This is important ... preview packages are never released to the 
Maven Central repository, only final releases are distributed via Maven 
Central.</p>
-
-<p>A stability vote may follow a preview package. This is to vote the code 
base up to the next level of stability (to "beta", then "rc", then "stable"). 
This a lazy consensus vote.</p>
-
-<h1 id="VersionNumbers-StableReleases">Stable Releases</h1>
-
-<p>Once a version has been voted "stable", a  release may be built and 
uploaded to the Apache Nexus. A stable release also includes additional 
non-Maven artifacts containing the project's source code, and additional<br 
clear="none">
-artifacts containing JavaDoc or other reports. The other artifacts are 
distributed via the Apache Mirrors.</p>
-
-<p>The vote for a  release is a binding vote, requiring at least 3 +1 votes 
and no vetoes, as outlined in <a  class="external-link" 
href="http://www.apache.org/foundation/voting.html";>http://www.apache.org/foundation/voting.html</a></p>
-
-<p>Following a successful release vote, the final release artifacts in the 
Apache Nexus repository may be released to the Maven Central repository, and 
the additional artifacts moved into place for download from the  Apache 
distribution mirrors.  This is also the point at which the Tapestry wiki is 
updated to announce the new release (and provide proper links to it), as well 
as announcements on the Tapestry user mailing list and elsewhere.</p>
-
-<p>Bug fix releases are follow-ons to stable releases.  Bug fix versions 
automatically start at stability "rc", reflecting the fact that only localized 
bug fixes are expected to be included in such a release. Once all desired bug 
fixes are in place, a stability vote (to "stable") is followed by a release 
vote.</p></div>
+</div>This document describes Tapestry's version numbering system. This is 
important, as version numbers relate both to artifacts available for download, 
or from a Maven repository, and also to bugs recorded in the issue tracking 
system.<h1 id="VersionNumbers-TapestryReleaseNumbers">Tapestry Release 
Numbers</h1><p>Tapestry release numbers consist of a product version number, 
and release index number, seperated by periods, for example "5.3". The product 
version number, 5, is unlikely to change any time soon (it would indicate a 
non-backwards compatible rewrite of the framework, and we've had enough of 
that, thank you very much).</p><h1 
id="VersionNumbers-TapestryStableReleaseVersions">Tapestry Stable Release 
Versions</h1><p>Tapestry stable releases use the name version number as the 
release number.</p><p>A bug fix release follows a stable release, when 
necessary. Bug fix releases add a sequence number to the product release 
number. Thus, the first bug fix release for Tapestry 5.3 wil
 l be version 5.3.1, then 5.3.2, as necessary.</p><p>A bug fix release 
<em>replaces</em> the previous stable release.</p><h1 
id="VersionNumbers-PreviewVersions">Preview Versions</h1><p>During the course 
of development of a release, there will be preview releases of non-final 
versions. A preview version consists of the product version, a stability term, 
and an index number, separated by dashes. The stability term is "alpha", 
"beta", or "rc".</p><p>The index number starts at 1. A preview version number 
might be "5.3-alpha-2", or "5.3-beta-1", for example. The index number resets 
back to one when the stability itself is upgraded.</p><p>"alpha" versions are 
not stable; the represent functionality in flux; classes and methods may be 
renamed or otherwise refactored between releases.</p><p>"beta" versions occur 
once main functionality is complete; they exist to fix bugs in both old and new 
functionality, and fill any gaps in functionality.</p><p>"rc" versions are 
"release candidates"; the f
 unctionality should be solid; the point of a release candidate is to get wide 
exposure to the new codebase to ensure that the final release is free of 
bugs.</p><h1 id="VersionNumbers-PreviewPackages">Preview Packages</h1><p>A 
preview package may be created at any time. A tag is created in Git to label 
the exact source from which the preview package is generated. The preview 
package is built and uploaded to the Apache Nexus. Once uploaded, the master 
version number (in trunk) should be advanced to the next index number within 
the same stability series (example: "5.3-alpha-2" to "5.3-alpha-3").</p><p>The 
Apache Nexus URL for the preview package may be distributed on the Tapestry 
user mailing list. However, preview packages are deleted, not released. This is 
important ... preview packages are never released to the Maven Central 
repository, only final releases are distributed via Maven Central.</p><p>A 
stability vote may follow a preview package. This is to vote the code base up 
to the 
 next level of stability (to "beta", then "rc", then "stable"). This a lazy 
consensus vote.</p><h1 id="VersionNumbers-StableReleases">Stable 
Releases</h1><p>Once a version has been voted "stable", a release may be built 
and uploaded to the Apache Nexus. A stable release also includes additional 
non-Maven artifacts containing the project's source code, and additional<br 
clear="none"> artifacts containing JavaDoc or other reports. The other 
artifacts are distributed via the Apache Mirrors.</p><p>The vote for a release 
is a binding vote, requiring at least 3 +1 votes and no vetoes, as outlined in 
<a  class="external-link" 
href="http://www.apache.org/foundation/voting.html";>http://www.apache.org/foundation/voting.html</a></p><p>Following
 a successful release vote, the final release artifacts in the Apache Nexus 
repository may be released to the Maven Central repository, and the additional 
artifacts moved into place for download from the Apache distribution mirrors. 
This is also the point
  at which the Tapestry wiki is updated to announce the new release (and 
provide proper links to it), as well as announcements on the Tapestry user 
mailing list and elsewhere.</p><p>Bug fix releases are follow-ons to stable 
releases. Bug fix versions automatically start at stability "rc", reflecting 
the fact that only localized bug fixes are expected to be included in such a 
release. Once all desired bug fixes are in place, a stability vote (to 
"stable") is followed by a release vote.</p></div>
       </div>
 
       <div class="clearer"></div>



Reply via email to