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

svn commit: r958985 [13/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/forms-and-validation.html
==============================================================================
--- websites/production/tapestry/content/forms-and-validation.html (original)
+++ websites/production/tapestry/content/forms-and-validation.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"/>
 
@@ -58,11 +68,22 @@
 
 <div id="content">
 <div id="ConfluenceContent"><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>The life's blood of any application is form input; this is the most effective way to gather significant information from the user. Whether it's a search form, a login screen or a multi-page registration wizard, forms are how the user really expresses themselves to the application.</p><p>Tapestry excels at creating forms and validating input. Input validation is declarative, meaning you simply tell Tapestry what validations to apply to a given field, and it takes care of it on the server and (once implemented) on the client as well.</p><p>Finally, Tapestry is able to not only present the errors back to the user, but to decorate the fields and the labels for the fields, marking them as containing errors (primarily, using CSS effects).</p><p><strong>Contents</strong></p><p></p><div class="toc
 -macro client-side-toc-macro" data-headerelements="H1,H2,H3,H4,H5,H6,H7"></div><h1 id="FormsandValidation-TheFormComponent">The Form Component</h1><p>The core of Tapestry's form support is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Form.html">Form</a> component. The Form component encloses (wraps around) all the other <em>field components</em> such as <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html">TextField</a>, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextArea.html">TextArea</a>, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checkbox.html">Checkbox</a>, etc.</p><h2 id="FormsandValidation-FormEvents">Form Events</h2><p>The Form component 
 emits a number of <a shape="rect" href="component-events.html">component events</a>. You'll need to provide event handler methods for some of these.</p><p>When rendering, the Form component emits two notifications: first, "prepareForRender", then "prepare". These allow the Form's container to setup any fields or properties that will be referenced in the form. For example, this is a good place to create a temporary entity object to be rendered, or to load an entity from a database to be edited.</p><p>When user submits the form on the client, a series of steps occur on the server.</p><p>First, the Form emits a "prepareForSubmit" notification, then a "prepare" notification. These allow the container to ensure that objects are set up and ready to receive information from the form submission.</p><p>Next, all the fields inside the form are activated to pull values out of the incoming request, validate them and (if valid) store the changes.</p><div class="navmenu" style="float:right; width
 :25%; 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>The life's blood of any application is form input; this is the most effective way to gather significant information from the user. Whether it's a search form, a login screen or a multi-page registration wizard, forms are how the user really expresses themselves to the application.</p><p>Tapestry excels at creating forms and validating input. Input validation is declarative, meaning you simply tell Tapestry what validations to apply to a given field, and it takes care of it on the server and (once implemented) on the client as well.</p><p>Finally, Tapestry is able to not only present the errors back to the user, but to decorate the fields and the labels for the fields, marking them as containing errors (primarily, using CSS effects).</p><p><strong>Contents</strong></p><p><style type="text/c
 ss">/*<![CDATA[*/
+div.rbtoc1437340849383 {padding: 0px;}
+div.rbtoc1437340849383 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1437340849383 li {margin-left: 0px;padding-left: 0px;}
+
+/*]]>*/</style></p><div class="toc-macro rbtoc1437340849383">
+<ul class="toc-indentation"><li><a shape="rect" href="#FormsandValidation-TheFormComponent">The Form Component</a>
+<ul class="toc-indentation"><li><a shape="rect" href="#FormsandValidation-FormEvents">Form Events</a></li><li><a shape="rect" href="#FormsandValidation-TrackingValidationErrors">Tracking Validation Errors</a></li><li><a shape="rect" href="#FormsandValidation-StoringDataBetweenRequests">Storing Data Between Requests</a></li><li><a shape="rect" href="#FormsandValidation-ConfiguringFieldsandLabels">Configuring Fields and Labels</a></li><li><a shape="rect" href="#FormsandValidation-CentralizingValidationwith@Validate">Centralizing Validation with @Validate</a></li><li><a shape="rect" href="#FormsandValidation-ServerSideValidation">Server Side Validation</a></li><li><a shape="rect" href="#FormsandValidation-CustomizingValidationMessages">Customizing Validation Messages</a>
+<ul class="toc-indentation"><li><a shape="rect" href="#FormsandValidation-CustomizingValidationMessagesforBeanEditForm">Customizing Validation Messages for BeanEditForm</a></li></ul>
+</li><li><a shape="rect" href="#FormsandValidation-ConfiguringValidatorContraintsintheMessageCatalog">Configuring Validator Contraints in the Message Catalog</a></li><li><a shape="rect" href="#FormsandValidation-ValidationMacros">Validation Macros</a></li><li><a shape="rect" href="#FormsandValidation-OverridingtheTranslatorwithEvents">Overriding the Translator with Events</a></li></ul>
+</li></ul>
+</div><h1 id="FormsandValidation-TheFormComponent">The Form Component</h1><p>The core of Tapestry's form support is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Form.html">Form</a> component. The Form component encloses (wraps around) all the other <em>field components</em> such as <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html">TextField</a>, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextArea.html">TextArea</a>, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Checkbox.html">Checkbox</a>, etc.</p><h2 id="FormsandValidation-FormEvents">Form Events</h2><p>The Form component emits a number of <a shape="rect" href="component-events.html">component 
 events</a>. You'll need to provide event handler methods for some of these.</p><p>When rendering, the Form component emits two notifications: first, "prepareForRender", then "prepare". These allow the Form's container to setup any fields or properties that will be referenced in the form. For example, this is a good place to create a temporary entity object to be rendered, or to load an entity from a database to be edited.</p><p>When user submits the form on the client, a series of steps occur on the server.</p><p>First, the Form emits a "prepareForSubmit" notification, then a "prepare" notification. These allow the container to ensure that objects are set up and ready to receive information from the form submission.</p><p>Next, all the fields inside the form are activated to pull values out of the incoming request, validate them and (if valid) store the changes.</p><div class="navmenu" style="float:right; width:25%; background:#eee; margin:3px; padding:3px">
 <p><em>For Tapestry 4 Users:</em> Tapestry 5 does not use the fragile "form rewind" approach from Tapestry 4. Instead, a hidden field generated during the render stores the information needed to process the form submission.</p></div><p>After the fields have done their processing, the Form emits a "validate" event. This is a chance to perform cross-form validation that can't be described declaratively.</p><p>Note: For compatibility with release 5.1 and earlier, the Form component also emits a "validateForm" event. (See <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/TAP5-760">TAP5-760</a>.)</p><p>Next, the Form determines if there have been any validation errors. If there have been, then the submission is considered a failure, and a "failure" event is emitted. If there have been no validation errors, then a "success" event is emitted.</p><p>Finally, the Form emits a "submit" event, for logic that doesn't care about success or failure.</p><div class="
 table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Form Event (in order)</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Phase</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>When emitted</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Typical use</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>prepareForRender</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Render</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Before rendering the form</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Load an entity from a database to be edited</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>prepare</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Render</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Before rendering the form, but after <em>prepareForRender</em></p></td><td colspan="1" rowspan="1" class="confl
 uenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>prepareForSubmit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Before the submitted form is processed</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>prepare</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Before the submitted form is processed, but after <em>prepareForSubmit</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>validate</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>After fields have been populated from submitted values and validated</p></td><td colspan="1" rowspan="1" cl
 ass="confluenceTd"><p>Perform cross-field validation</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>validateForm</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>same as <em>validate</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>deprecated</em></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>failure</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>After one or more validation errors have occurred</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>success</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>When validation has completed <em>without</em> any errors</p></td><td colspan="1" rowspan="1" class="con
 fluenceTd"><p>Save changes to the database</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Submit</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>After all validation (success or failure) has finished</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr></tbody></table></div><p>Note that the "prepare" event is emitted during both form rendering and form submission.</p><h2 id="FormsandValidation-TrackingValidationErrors">Tracking Validation Errors</h2><p>Associated with the Form is a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValidationTracker.html">ValidationTracker</a> that tracks all the provided user input and validation errors for every field in the form. The tracker can be provided to the Form via the Form's tracker parameter, but this is rarely necessary.</p><p>The Form includes methods <
 code>isValid()</code> and <code>getHasErrors()</code>, which are used to see if the Form's validation tracker contains any errors.</p><p>In your own logic, it is possible to record your own errors. Form includes two different versions of method <code>recordError()</code>, one of which specifies a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/Field.html">Field</a> (an interface implemented by all form element components), and one of which is for "global" errors, unassociated with any particular field.</p><h2 id="FormsandValidation-StoringDataBetweenRequests">Storing Data Between Requests</h2><div class="navmenu" style="float:right; width:40%; background:white; margin:3px; padding:3px">
 <div class="confluence-information-macro confluence-information-macro-information"><p class="title">New in Tapestry 5.4</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
 <p>Starting in Tapestry 5.4, the default behavior for server-side validation failures is to re-render the page within the same request (rather than emitting a redirect). This removes the need to use a session-persistent field to store the validation tracker when validation failures occur.</p></div></div></div><p>As with other action requests, the result of a form submission (except when using <a shape="rect" href="ajax-and-zones.html">Zones</a>) is to send a redirect to the client, which results in a second request (to re-render the page). The ValidationTracker must be <a shape="rect" href="persistent-page-data.html">persisted</a> (generally in the HttpSession) across these two requests in order to prevent the loss of validation information. Fortunately, the default ValidationTracker provided by the Form component is persistent, so you don't normally have to worry about it.</p><p>However, for the same reason, the individual fields updated by the components should also be persisted a
 cross requests, and this is something you <strong>do</strong> need to do yourself &#8211; generally with the @Persist annotation.</p><p>For example, a Login page, which collects a user name and a password, might look like:</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[package com.example.newapp.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package com.example.newapp.pages;
 
 
 import com.example.newapp.services.UserAuthenticator;
@@ -74,7 +95,7 @@ import org.apache.tapestry5.ioc.annotati
 
 public class Login {
     @Persist
-    @Property 
+    @Property&#160;
     private String userName;
 
     @Property
@@ -83,7 +104,7 @@ public class Login {
     @Inject
     private UserAuthenticator authenticator;
 
-    @InjectComponent(&quot;password&quot;)
+    @InjectComponent("password")
     private PasswordField passwordField;
 
     @Component
@@ -94,13 +115,13 @@ public class Login {
      */
     void onValidateFromLoginForm() {
         if (!authenticator.isValid(userName, password)) {
-            // record an error, and thereby prevent Tapestry from emitting a &quot;success&quot; event
-            loginForm.recordError(passwordField, &quot;Invalid user name or password.&quot;);
+            // record an error, and thereby prevent Tapestry from emitting a "success" event
+            loginForm.recordError(passwordField, "Invalid user name or password.");
         }
     }
 
     /**
-     * Validation passed, so we&#39;ll go to the &quot;PostLogin&quot; page
+     * Validation passed, so we'll go to the "PostLogin" page
      */
     Object onSuccess() {
         return PostLogin.class;
@@ -108,79 +129,79 @@ public class Login {
 }
 
 
-]]></script>
+</pre>
 </div></div><div class="navmenu" style="float:right; width:40%; background:white; margin:3px; padding:3px">
 <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>Note that the onValidateFromLoginForm() and onSuccess() methods are not public; event handler methods can have any visibility, even private. Package private (that is, no modifier) is the typical use, as it allows the component to be tested, from a test case class in the same package.</p></div></div></div><p>Because a form submission is really <em>two</em> requests: the submission itself (which results in a redirect response), then a second request for the page (which results in a re-rendering of the page), it is necessary to persist the userName field between the two requests, by using the @Persist annotation. This would be necessary for the password field as well, except that the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/PasswordField.html">PasswordField</a> component never renders a value.</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-ic
 on-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>To avoid data loss, fields whose values are stored in the HttpSession (such as userName, above) must be serializable, particularly if you want to be able to cluster your application or preserve sessions across server restarts.</p></div></div><p>The Form only emits a "success" event if the there are no prior validation errors. This means it is not necessary to write <code>if (form.getHasErrors()) return;</code> as the first line of the method.</p><p>Finally, notice how business logic fits into validation. The UserAuthenticator service is responsible for ensuring that the userName and (plaintext) password are valid. When it returns false, we ask the Form component to record an error. We provide the PasswordField instance as the first parameter; this ensures that the password field, and its label, are decorated when the Form is re-rendered, to present the errors to 
 the user.</p><h2 id="FormsandValidation-ConfiguringFieldsandLabels">Configuring Fields and Labels</h2><p>The template for the Login page contains a minimal amount of Tapestry instrumentation and references some of the <a shape="rect" class="external-link" href="http://getbootstrap.com" >Bootstrap</a> CSS classes (Bootstrap is automatically integrated into each Tapestry page):</p><div class="code panel pdl" style="border-width: 1px;"><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;newapp com.example&quot;
-      xmlns:t=&quot;http://tapestry.apache.org/schema/tapestry_5_4.xsd&quot;&gt;
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;html t:type="layout" title="newapp com.example"
+      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"&gt;
 
-    &lt;div class=&quot;row&quot;&gt;
-        &lt;div class=&quot;span4 offset3&quot;&gt;
-            &lt;t:form t:id=&quot;loginForm&quot;&gt;
+    &lt;div class="row"&gt;
+        &lt;div class="span4 offset3"&gt;
+            &lt;t:form t:id="loginForm"&gt;
                 &lt;h2&gt;Please sign in&lt;/h2&gt;
-                &lt;t:textfield t:id=&quot;userName&quot; t:mixins=&quot;formgroup&quot;/&gt;
-                &lt;t:passwordfield t:id=&quot;password&quot; value=&quot;password&quot; t:mixins=&quot;formgroup&quot;/&gt;
-                &lt;t:submit class=&quot;btn btn-large btn-primary&quot; value=&quot;Sign in&quot;/&gt;
+                &lt;t:textfield t:id="userName" t:mixins="formgroup"/&gt;
+                &lt;t:passwordfield t:id="password" value="password" t:mixins="formgroup"/&gt;
+                &lt;t:submit class="btn btn-large btn-primary" value="Sign in"/&gt;
             &lt;/t:form&gt;
         &lt;/div&gt;
     &lt;/div&gt;
 
 &lt;/html&gt;
-]]></script>
-</div></div><p>Rendering the page gives a reasonable pleasing first pass:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" width="500" src="forms-and-validation.data/newapp_com_example.png" data-image-src="/confluence/download/attachments/22872109/newapp_com_example.png?version=3&amp;modificationDate=1428088849000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="55476324" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="newapp_com_example.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="22872109" data-linked-resource-container-version="45"></span></p><p>The Tapestry Form component is responsible for creating the necessary URL for the form submission (this is Tapestry's responsi
 bility, not yours).</p><p><span style="line-height: 1.4285715;">For the TextField, we provide a component id, userName. We could specify the </span><code style="line-height: 1.4285715;">value</code><span style="line-height: 1.4285715;"> parameter, but the default is to match the TextField's id against a property of the container, the Login page, if such a property exists.&#160;</span></p><p>As a rule of thumb, you should always give your fields a specific id (this id will be used to generate the <code>name</code> and <code>id</code> attributes of the rendered tag). Being allowed to omit the value parameter helps to keep the template from getting too cluttered.</p><p>The FormGroup mixin decorates the field with some additional markup, including a &lt;label&gt; element; this leverages more of Bootstrap.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>userName component as rendered</b></div><div clas
 s="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;div class=&quot;form-group&quot;&gt;
-  &lt;label for=&quot;userName&quot; class=&quot;control-label&quot;&gt;User Name&lt;/label&gt;
-  &lt;input id=&quot;userName&quot; class=&quot;form-control&quot; name=&quot;userName&quot; type=&quot;text&quot;&gt;
-&lt;/div&gt;]]></script>
+</pre>
+</div></div><p>Rendering the page gives a reasonable pleasing first pass:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" width="500" src="forms-and-validation.data/newapp_com_example.png"></span></p><p>The Tapestry Form component is responsible for creating the necessary URL for the form submission (this is Tapestry's responsibility, not yours).</p><p><span style="line-height: 1.4285715;">For the TextField, we provide a component id, userName. We could specify the </span><code style="line-height: 1.4285715;">value</code><span style="line-height: 1.4285715;"> parameter, but the default is to match the TextField's id against a property of the container, the Login page, if such a property exists.&#160;</span></p><p>As a rule of thumb, you should always give your fields a specific id (this id will be used to generate the <code>name</code> and <co
 de>id</code> attributes of the rendered tag). Being allowed to omit the value parameter helps to keep the template from getting too cluttered.</p><p>The FormGroup mixin decorates the field with some additional markup, including a &lt;label&gt; element; this leverages more of Bootstrap.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>userName component as rendered</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;div class="form-group"&gt;
+  &lt;label for="userName" class="control-label"&gt;User Name&lt;/label&gt;
+  &lt;input id="userName" class="form-control" name="userName" type="text"&gt;
+&lt;/div&gt;</pre>
 </div></div><p>&#160;</p><p><span style="color: rgb(83,145,38);font-size: 24.0px;line-height: 1.25;">Form Validation</span></p><p>So, this is a basic (very basic!) form and you can leave the fields blank and submit the form. With very little effort we can add client-side validation, to prevent the user from submitting the form with either field left blank.</p><p>Validation in Tapestry involves associating one or more&#160;<em>validators</em> with a form element component, such as TextField or PasswordField. This can be done using the validate parameter of the component itself.</p><p><span style="color: rgb(83,145,38);font-size: 20.0px;line-height: 1.5;">Available Validators</span></p><p>Tapestry provides the following built-in validators:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Validator</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Constraint Type</p></th><th colspan="1" rowspan="1" class
 ="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Example</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>email</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#8211;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Ensures that the given input looks like a valid e-mail address</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="email" validate="email" /&gt;</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>max</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Enforces a maximum integer value</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="age" validate="max=120,min=0" /&gt;</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>maxLength</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>int<
 /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Makes sure that a string value has a maximum length</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="zip" validate="maxlength=7" /&gt;</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>min</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Enforces a minimum integer value</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="age" validate="max=120,min=0" /&gt;</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>minLength</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Makes sure that a string value has a minimum length</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="somefield" validate="minlength=1" /&gt;</code></
 p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#8211;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Does nothing (used to override a @Validate annotation)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="somefield" validate="none" /&gt;</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>regexp</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>pattern</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Makes sure that a string value conforms to a given pattern</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="letterfield" validate="regexp=^</code><code>[A-Za-z]+$" /&gt;</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>required</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#8211;</p></td><td colspan="1" rowspan="1" class="co
 nfluenceTd"><p>Makes sure that a string value is not null and not the empty string</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>&lt;t:textfield value="name" validate="required" /&gt;</code></p></td></tr></tbody></table></div><h2 id="FormsandValidation-CentralizingValidationwith@Validate">Centralizing Validation with @Validate</h2><p>The @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/beaneditor/Validate.html">Validate</a> annotation can take the place of the validate parameter of TextField, PasswordField, TextArea and other components. When the validate parameter is not bound, the component will check for the @Validate annotation and use its value as the validation definition.</p><p>The annotation may be placed on the getter or setter method, or on the field itself.</p><p>Update the two fields of the Login page:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelCont
 ent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  @Persist
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  @Persist
   @Property
-  @Validate(&quot;required&quot;)
+  @Validate("required")
   private String userName;
 
   @Property
-  @Validate(&quot;required&quot;)
- private String password;]]></script>
-</div></div><p>Now, rebuild the app, refresh the browser, and just hit enter:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" width="500" src="forms-and-validation.data/newapp_com_example.png" data-image-src="/confluence/download/attachments/22872109/newapp_com_example.png?version=3&amp;modificationDate=1428088849000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="55476324" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="newapp_com_example.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="22872109" data-linked-resource-container-version="45"></span></p><p>The form has updated, in place, to present the errors. You will not be able to submit the form until some value is provide
 d for each field.</p><h2 id="FormsandValidation-ServerSideValidation">Server Side Validation</h2><p>Some validation can't, or shouldn't, be done on the client side. How do we know if the password is correct? Short of downloading all users and passwords to the client, we really need to do the validation on the server.</p><p>In fact, all client-side validation (via the validate parameter, or&#160;@Validate annotation) is performed again on the server.</p><p>It is also possible to perform extra validation there.</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[  /**
+  @Validate("required")
+ private String password;</pre>
+</div></div><p>Now, rebuild the app, refresh the browser, and just hit enter:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" width="500" src="forms-and-validation.data/newapp_com_example.png"></span></p><p>The form has updated, in place, to present the errors. You will not be able to submit the form until some value is provided for each field.</p><h2 id="FormsandValidation-ServerSideValidation">Server Side Validation</h2><p>Some validation can't, or shouldn't, be done on the client side. How do we know if the password is correct? Short of downloading all users and passwords to the client, we really need to do the validation on the server.</p><p>In fact, all client-side validation (via the validate parameter, or&#160;@Validate annotation) is performed again on the server.</p><p>It is also possible to perform extra validation there.</p><div cla
 ss="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  /**
      * Do the cross-field validation
      */
     void onValidateFromLoginForm() {
         if (!authenticator.isValid(userName, password)) {
-            // record an error, and thereby prevent Tapestry from emitting a &quot;success&quot; event
-            loginForm.recordError(passwordField, &quot;Invalid user name or password.&quot;);
+            // record an error, and thereby prevent Tapestry from emitting a "success" event
+            loginForm.recordError(passwordField, "Invalid user name or password.");
         }
     }
 
-]]></script>
-</div></div><p>This is the validate event handler from the loginForm component. It is invoked once all the components have had a chance to read values out of the request, do their own validations, and update the properties they are bound to.</p><p>In this case, the authenticator is used to decide if the userName and password is valid. In a real application, this would be where a database or other external service was consulted.</p><p>If the combination is not valid, then the password field is marked as in error. The form is used to record an error, about a component (the passwordField) with an error message.</p><p>Entering any two values into the form and submitting will cause a round trip; the form will re-render to present the error to the user:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" width="500" src="forms-and-validation.data/newapp
 _com_example.png" data-image-src="/confluence/download/attachments/22872109/newapp_com_example.png?version=3&amp;modificationDate=1428088849000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="55476324" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="newapp_com_example.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="22872109" data-linked-resource-container-version="45"></span></p><p>Notice that the cursor is placed directly into the password field.</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>In versions of Tapestry prior to 5.4, a form with validation errors would result in a redirect response to the client; often, temporary server-
 side data (such as the userName field) would be lost. Starting in 5.4, submitting a form with validation errors results in the new page being rendered in the same request as the form submission.</p></div></div><p>&#160;</p><h2 id="FormsandValidation-CustomizingValidationMessages">Customizing Validation Messages</h2><p>Each validator (such as "required" or "minlength") has a default message used (on the client side and the server side) when the constraint is violated; that is, when the user input is not valid.</p><p>The message can be customized by adding an entry to the page's <a shape="rect" href="localization.html">message catalog</a> (or the containing component's message catalog). As with any localized property, this can also go into the application's message catalog.</p><p>The first key checked is <em>formId</em>-<em>fieldId</em>-<em>validatorName</em>-message.</p><ul><li>formId: the local component id of the Form component</li><li>fieldId: the local component id of the field (
 TextField, etc.)</li><li>validatorName: the name of the validator, i.e., "required" or "minlength"<br clear="none"> If there is not message for that key, a second check is made, for <em>fieldId</em>-<em>validatorName</em>-message.</li></ul><p>If that does not match a message, then the built-in default validation message is used.</p><h3 id="FormsandValidation-CustomizingValidationMessagesforBeanEditForm">Customizing Validation Messages for BeanEditForm</h3><p>The <a shape="rect" href="beaneditform-guide.html">BeanEditForm</a> component also supports validation message customizing. The search for messages is similar; the <em>formId</em> is the component id of the BeanEditForm component (not the Form component it contains). The <em>fieldId</em> is the property name.</p><h2 id="FormsandValidation-ConfiguringValidatorContraintsintheMessageCatalog">Configuring Validator Contraints in the Message Catalog</h2><p>It is possible to omit the validation constraint from the validate parameter (o
 r @Validator annotation), in which case it is expected to be stored in the message catalog.</p><p>This is useful when the validation constraint is awkward to enter inline, such as a regular expression for use with the regexp validator.</p><p>The key here is similar to customizing the validation message: <em>formId</em>-<em>fieldId</em>-<em>validatorName</em> or just <em>fieldId</em>-<em>validatorName</em>.</p><p>For example, your template may have the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  &lt;t:textfield t:id=&quot;ssn&quot; validate=&quot;required,regexp&quot;/&gt;
-]]></script>
+</pre>
+</div></div><p>This is the validate event handler from the loginForm component. It is invoked once all the components have had a chance to read values out of the request, do their own validations, and update the properties they are bound to.</p><p>In this case, the authenticator is used to decide if the userName and password is valid. In a real application, this would be where a database or other external service was consulted.</p><p>If the combination is not valid, then the password field is marked as in error. The form is used to record an error, about a component (the passwordField) with an error message.</p><p>Entering any two values into the form and submitting will cause a round trip; the form will re-render to present the error to the user:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" width="500" src="forms-and-validation.data/newapp
 _com_example.png"></span></p><p>Notice that the cursor is placed directly into the password field.</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>In versions of Tapestry prior to 5.4, a form with validation errors would result in a redirect response to the client; often, temporary server-side data (such as the userName field) would be lost. Starting in 5.4, submitting a form with validation errors results in the new page being rendered in the same request as the form submission.</p></div></div><p>&#160;</p><h2 id="FormsandValidation-CustomizingValidationMessages">Customizing Validation Messages</h2><p>Each validator (such as "required" or "minlength") has a default message used (on the client side and the server side) when the constraint is violated; that is, when the user input is not valid.</p><p>The m
 essage can be customized by adding an entry to the page's <a shape="rect" href="localization.html">message catalog</a> (or the containing component's message catalog). As with any localized property, this can also go into the application's message catalog.</p><p>The first key checked is <em>formId</em>-<em>fieldId</em>-<em>validatorName</em>-message.</p><ul><li>formId: the local component id of the Form component</li><li>fieldId: the local component id of the field (TextField, etc.)</li><li>validatorName: the name of the validator, i.e., "required" or "minlength"<br clear="none"> If there is not message for that key, a second check is made, for <em>fieldId</em>-<em>validatorName</em>-message.</li></ul><p>If that does not match a message, then the built-in default validation message is used.</p><h3 id="FormsandValidation-CustomizingValidationMessagesforBeanEditForm">Customizing Validation Messages for BeanEditForm</h3><p>The <a shape="rect" href="beaneditform-guide.html">BeanEditForm
 </a> component also supports validation message customizing. The search for messages is similar; the <em>formId</em> is the component id of the BeanEditForm component (not the Form component it contains). The <em>fieldId</em> is the property name.</p><h2 id="FormsandValidation-ConfiguringValidatorContraintsintheMessageCatalog">Configuring Validator Contraints in the Message Catalog</h2><p>It is possible to omit the validation constraint from the validate parameter (or @Validator annotation), in which case it is expected to be stored in the message catalog.</p><p>This is useful when the validation constraint is awkward to enter inline, such as a regular expression for use with the regexp validator.</p><p>The key here is similar to customizing the validation message: <em>formId</em>-<em>fieldId</em>-<em>validatorName</em> or just <em>fieldId</em>-<em>validatorName</em>.</p><p>For example, your template may have the following:</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="ssn" validate="required,regexp"/&gt;
+</pre>
 </div></div><p>And your message catalog can contain:</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[ssn-regexp=\d{3}-\d{2}-\d{4}
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">ssn-regexp=\d{3}-\d{2}-\d{4}
 ssn-regexp-message=Social security numbers are in the format 12-34-5678.
-]]></script>
+</pre>
 </div></div><p>This technique also works with the BeanEditForm; as with validation messages, the formId is the BeanEditForm component's id, and the fieldId is the name of the property being editted.</p><h2 id="FormsandValidation-ValidationMacros">Validation Macros</h2>
 
 <div class="confluence-information-macro confluence-information-macro-information"><p class="title">Added in 5.2</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 style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
 <p>&#160;</p></div><p>Lists of validators can be combined into <em>validation macros</em>. This mechanism is convenient for ensuring consistent validation rules across an application. To create a validation macro, just contribute to the ValidatorMacro Service in your module class (normally AppModule.java), by adding a new entry to the configuration object, as shown below. The first parameter is the name of your macro, the second is a comma-separated list of validators:</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[@Contribute(ValidatorMacro.class)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Contribute(ValidatorMacro.class)
 public static void combinePasswordValidators(MappedConfiguration&lt;String, String&gt; configuration) {
-      configuration.add(&quot;password&quot;,&quot;required,minlength=5,maxlength=15,&quot;);
+      configuration.add("password","required,minlength=5,maxlength=15,");
 }
-]]></script>
+</pre>
 </div></div><p>Then, you can use this new macro in component templates and classes:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;input t:type=&quot;textField&quot; t:id=&quot;password&quot; t:validate=&quot;password&quot; /&gt;
-]]></script>
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;input t:type="textField" t:id="password" t:validate="password" /&gt;
+</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[@Validate(&quot;password&quot;)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Validate("password")
 private String password;
-]]></script>
+</pre>
 </div></div><h2 id="FormsandValidation-OverridingtheTranslatorwithEvents">Overriding the Translator with Events</h2><p>The TextField, PasswordField and TextArea components all have a translate parameter, a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/FieldTranslator.html">FieldTranslator</a> object that is used to convert values on the server side to strings on the client side.</p><p>In most cases, the translate parameter is not set explicitly; Tapestry derives an appropriate value based on the type of property being editted by the field.</p><p>In certain cases, you may want to override the translator. This can be accomplished using two events triggered on the component, "toclient" and "parseclient".</p><p>The "toclient" event is passed the current object value and returns a string, which will be the default value for the field. When there is no event handler, or when the event handler returns null, the default Translato
 r is used to convert the server side value to a string.</p><p>For example, you may have a quantity field that you wish to display as blank, rather than zero, initially:</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[  &lt;t:textfield t:id=&quot;quantity&quot; size=&quot;10&quot;/&gt;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  &lt;t:textfield t:id="quantity" size="10"/&gt;
 
   . . .
 
@@ -188,25 +209,25 @@ private String password;
 
   String onToClientFromQuantity()
   {
-    if (quantity == 0) return &quot;&quot;;
+    if (quantity == 0) return "";
 
     return null;
   }
-]]></script>
+</pre>
 </div></div><p>This is good so far, but if the field is optional and the user submits the form, you'll get a validation error, because the empty string is not valid as an integer.</p><p>That's where the "parseclient" event comes in:</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[  Object onParseClientFromQuantity(String input)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  Object onParseClientFromQuantity(String input)
   {
-    if (&quot;&quot;.equals(input)) return 0;
+    if ("".equals(input)) return 0;
 
     return null;
   }
-]]></script>
+</pre>
 </div></div><p>The event handler method has precedence over the translator. Here it checks for the empty string (and note that the input may be null!) and evaluates that as zero.</p><p>Again, returning null lets the normal translator do its work.</p><p>The event handler may also throw a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValidationException.html">ValidationException</a> to indicate a value that can't be parsed.</p><p>Now, what if you want to perform your own custom validation? That's another event: "validate":</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[  void onValidateFromCount(Integer value) throws ValidationException
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  void onValidateFromCount(Integer value) throws ValidationException
   {
-    if (value.equals(13)) throw new ValidationException(&quot;Thirteen is an unlucky number.&quot;);
+    if (value.equals(13)) throw new ValidationException("Thirteen is an unlucky number.");
   }
-]]></script>
+</pre>
 </div></div><p>This event gets fired <strong>after</strong> the normal validators. It is passed the <em>parsed</em> value (not the string from the client, but the object value from the translator, or from the "parseclient" event handler).</p><p>The method may not return a value, but may throw a ValidationException to indicate a problem with the value.</p><p><strong>Caution:</strong> These events are exclusively on the <em>server side</em>. This means that, in certain circumstances, an input value will be rejected on the client side even though it is valid on the server side. You may need to disable client-side validation in order to use this feature.</p></div>
 </div>
 

Modified: websites/production/tapestry/content/general-questions.html
==============================================================================
--- websites/production/tapestry/content/general-questions.html (original)
+++ websites/production/tapestry/content/general-questions.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,23 +67,16 @@
   </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="ScrollbarPrevName" width="33%">&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="frequently-asked-questions.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="frequently-asked-questions.html">Frequently Asked Questions</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="templating-and-markup-faq.html">Templating and Markup FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="templating-and-markup-faq.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><h2 id="GeneralQuestions-GeneralQuestions">General Questions</h2><p></p><div class="toc-m
 acro client-side-toc-macro" data-headerelements="H1,H2,H3,H4,H5,H6,H7"></div><h3 id="GeneralQuestions-HowdoIgetstartedwithTapestry?">How do I get started with Tapestry?</h3><p>The easiest way to get started is to use <a shape="rect" class="external-link" href="http://maven.apache.org">Apache Maven</a> to create your initial project; Maven can use an <em>archetype</em> (a kind of project template) to create a bare-bones Tapestry application for you. See the <a shape="rect" href="getting-started.html">Getting Started</a> page for more details.</p><p>Even without Maven, Tapestry is quite easy to set up. You just need to <a shape="rect" href="download.html">download</a> the binaries and setup your build to place them inside your WAR's WEB-INF/lib folder. The rest is just some one-time <a shape="rect" href="configuration.html">configuration of the web.xml deployment descriptor</a>.</p><h3 id="GeneralQuestions-WhydoesTapestryusePrototype?WhynotinsertfavoriteJavaScriptlibraryhere?">Why doe
 s Tapestry use Prototype? Why not <em>insert favorite JavaScript library here</em>?</h3><p>An important goal for Tapestry is seamless DHTML and Ajax integration. To serve that goal, it was important that the built in components be capable of Ajax operations, such as dynamically re-rendering parts of the page. Because of that, it made sense to bundle a well-known JavaScript library as part of Tapestry.</p><p>At the time (this would be 2006-ish), Prototype and Scriptaculous were well known and well documented, and jQuery was just getting started.</p><p>The intent has always been to make this aspect of Tapestry pluggable. Tapestry 5.4 includes the option of either Prototype or jQuery Tapestry 5.5 will remove Prototype as an option..</p><h3 id="GeneralQuestions-WhydoesTapestryhaveitsownInversionofControlContainer?WhynotSpringorGuice?">Why does Tapestry have its own Inversion of Control Container? Why not Spring or Guice?</h3><p>An Inversion of Control Container is <em>the</em> key piece
  of Tapestry's infrastructure. It is absolutely necessary to create software as robust, performant ,and extensible as Tapestry.</p><p>Tapestry IoC includes a number of features that distinguish itself from other containers:</p><ul><li>Configured in code, not XML</li><li>Built-in extension mechanism for services: configurations and contributions</li><li>Built-in aspect oriented programming model (service decorations and advice)</li><li>Easy modularization</li><li>Best-of-breed exception reporting</li></ul><p>Because Tapestry is implemented on top of its IoC container, and because the container makes it easy to extend or replace any service inside the container, it is possible to make the small changes to Tapestry needed to customize it to any project's needs.</p><h3 id="GeneralQuestions-HowdoIupgradefromTapestry4toTapestry5?">How do I upgrade from Tapestry 4 to Tapestry 5?</h3><p>There is no existing tool that supports upgrading from Tapestry 4 to Tapestry 5; Tapestry 5 is a complete
  rewrite.</p><p>Many of the basic concepts in Tapestry 4 are still present in Tapestry 5, but refactored, improved, streamlined, and simplified. The basic concept of pages, templates and components are largely the same. Other aspects, such as server-side event handling, is markedly different.</p><h3 id="GeneralQuestions-HowdoIupgradefromoneversionofTapestry5toanother?">How do I upgrade from one version of Tapestry 5 to another?</h3><p>A lot of effort goes into making an upgrade from one Tapestry 5 release to another go smoothly. In the general case, it is just a matter of updating the version number in your Maven <code>build.xml</code> or Gradle <code>build.gradle</code> file and executing the appropriate commands (e.g., <code>gradle idea</code> or <code>mvn eclipse:eclipse</code>) to bring your local workspace up to date with the latest binaries.</p><p>After changing dependencies, you should always perform a clean recompile of your application.</p><p>We make every effort to ensure 
 backwards-compatibility. Tapestry is mostly coded in terms of interfaces; those interfaces are stable to a point: interfaces your code is expected to implement are usually completely frozen; interfaces your code is expected to invoke, such as the interfaces to IoC services, are stable, but may have new methods added in a release; existing methods are not changed.</p><p>In <em>rare</em> cases a choice is necessary between fixing bugs (or adding essential functionality) and maintaining complete backwards compatibility; in those cases, an incompatible change may be introduced. These are always discussed in detail in the <a shape="rect" href="release-notes.html">Release Notes</a> for the specific release. You should always read the release notes before attempting an upgrade, and always (really, <em>always</em>) be prepared to retest your application afterwards.</p><p>Note that you should be careful any time you make use of <strong>internal</strong> APIs (you can tell an API is internal 
 by the package name, <code>org.apache.tapestry5.internal...</code>. Internal APIs may change <em>at any time</em>; there's no guarantee of backwards compatibility. Please always check on the documentation, or consult the user mailing list, to see if there's a stable, public alternative. If you do make use of internal APIs, be sure to get a discussion going so that your needs can be met in the future by a stable, public API.</p><p><span style="color: rgb(83,145,38);font-size: 16.0px;line-height: 1.5625;">Why are there both Request and HttpServletRequest?</span></p><p>Tapestry's Request interface is <em>very</em> close to the standard HttpServletRequest interface. It differs in a few ways, omitting some unneeded methods, and adding a couple of new methods (such as <code>isXHR()</code>), as well as changing how some existing methods operate. For example, <code>getParameterNames()</code> returns a sorted List of Strings; HttpServletRequest returns an Enumeration, which is a very dated a
 pproach.</p><p>However, the stronger reason for Request (and the related interfaces Response and Session) is to enable the support for Portlets at some point in the future. By writing code in terms of Tapestry's Request, and not HttpServletRequest, you can be assured that the same code will operate in both Servlet Tapestry and Portlet Tapestry.</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="ScrollbarPrevName" width="33%">&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="frequently-asked-questions.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="frequently-asked-questions.html">Frequently Asked Questions</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="templating-and-markup-faq.html">Templating and Markup FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="templating-and-markup-faq.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
+<div id="ConfluenceContent"><h2 id="GeneralQuestions-GeneralQuestions">General Questions</h2><p><style type="text/css">/*<![CDATA[*/
+div.rbtoc1437340835672 {padding: 0px;}
+div.rbtoc1437340835672 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1437340835672 li {margin-left: 0px;padding-left: 0px;}
+
+/*]]>*/</style></p><div class="toc-macro rbtoc1437340835672">
+<ul class="toc-indentation"><li><a shape="rect" href="#GeneralQuestions-GeneralQuestions">General Questions</a>
+<ul class="toc-indentation"><li><a shape="rect" href="#GeneralQuestions-HowdoIgetstartedwithTapestry?">How do I get started with Tapestry?</a></li><li><a shape="rect" href="#GeneralQuestions-WhydoesTapestryusePrototype?WhynotinsertfavoriteJavaScriptlibraryhere?">Why does Tapestry use Prototype? Why not insert favorite JavaScript library here?</a></li><li><a shape="rect" href="#GeneralQuestions-WhydoesTapestryhaveitsownInversionofControlContainer?WhynotSpringorGuice?">Why does Tapestry have its own Inversion of Control Container? Why not Spring or Guice?</a></li><li><a shape="rect" href="#GeneralQuestions-HowdoIupgradefromTapestry4toTapestry5?">How do I upgrade from Tapestry 4 to Tapestry 5?</a></li><li><a shape="rect" href="#GeneralQuestions-HowdoIupgradefromoneversionofTapestry5toanother?">How do I upgrade from one version of Tapestry 5 to another?</a></li></ul>
+</li></ul>
+</div><h3 id="GeneralQuestions-HowdoIgetstartedwithTapestry?">How do I get started with Tapestry?</h3><p>The easiest way to get started is to use <a shape="rect" class="external-link" href="http://maven.apache.org">Apache Maven</a> to create your initial project; Maven can use an <em>archetype</em> (a kind of project template) to create a bare-bones Tapestry application for you. See the <a shape="rect" href="getting-started.html">Getting Started</a> page for more details.</p><p>Even without Maven, Tapestry is quite easy to set up. You just need to <a shape="rect" href="download.html">download</a> the binaries and setup your build to place them inside your WAR's WEB-INF/lib folder. The rest is just some one-time <a shape="rect" href="configuration.html">configuration of the web.xml deployment descriptor</a>.</p><h3 id="GeneralQuestions-WhydoesTapestryusePrototype?WhynotinsertfavoriteJavaScriptlibraryhere?">Why does Tapestry use Prototype? Why not <em>insert favorite JavaScript librar
 y here</em>?</h3><p>An important goal for Tapestry is seamless DHTML and Ajax integration. To serve that goal, it was important that the built in components be capable of Ajax operations, such as dynamically re-rendering parts of the page. Because of that, it made sense to bundle a well-known JavaScript library as part of Tapestry.</p><p>At the time (this would be 2006-ish), Prototype and Scriptaculous were well known and well documented, and jQuery was just getting started.</p><p>The intent has always been to make this aspect of Tapestry pluggable. Tapestry 5.4 includes the option of either Prototype or jQuery Tapestry 5.5 will remove Prototype as an option..</p><h3 id="GeneralQuestions-WhydoesTapestryhaveitsownInversionofControlContainer?WhynotSpringorGuice?">Why does Tapestry have its own Inversion of Control Container? Why not Spring or Guice?</h3><p>An Inversion of Control Container is <em>the</em> key piece of Tapestry's infrastructure. It is absolutely necessary to create sof
 tware as robust, performant ,and extensible as Tapestry.</p><p>Tapestry IoC includes a number of features that distinguish itself from other containers:</p><ul><li>Configured in code, not XML</li><li>Built-in extension mechanism for services: configurations and contributions</li><li>Built-in aspect oriented programming model (service decorations and advice)</li><li>Easy modularization</li><li>Best-of-breed exception reporting</li></ul><p>Because Tapestry is implemented on top of its IoC container, and because the container makes it easy to extend or replace any service inside the container, it is possible to make the small changes to Tapestry needed to customize it to any project's needs.</p><h3 id="GeneralQuestions-HowdoIupgradefromTapestry4toTapestry5?">How do I upgrade from Tapestry 4 to Tapestry 5?</h3><p>There is no existing tool that supports upgrading from Tapestry 4 to Tapestry 5; Tapestry 5 is a complete rewrite.</p><p>Many of the basic concepts in Tapestry 4 are still pres
 ent in Tapestry 5, but refactored, improved, streamlined, and simplified. The basic concept of pages, templates and components are largely the same. Other aspects, such as server-side event handling, is markedly different.</p><h3 id="GeneralQuestions-HowdoIupgradefromoneversionofTapestry5toanother?">How do I upgrade from one version of Tapestry 5 to another?</h3><p>A lot of effort goes into making an upgrade from one Tapestry 5 release to another go smoothly. In the general case, it is just a matter of updating the version number in your Maven <code>build.xml</code> or Gradle <code>build.gradle</code> file and executing the appropriate commands (e.g., <code>gradle idea</code> or <code>mvn eclipse:eclipse</code>) to bring your local workspace up to date with the latest binaries.</p><p>After changing dependencies, you should always perform a clean recompile of your application.</p><p>We make every effort to ensure backwards-compatibility. Tapestry is mostly coded in terms of interface
 s; those interfaces are stable to a point: interfaces your code is expected to implement are usually completely frozen; interfaces your code is expected to invoke, such as the interfaces to IoC services, are stable, but may have new methods added in a release; existing methods are not changed.</p><p>In <em>rare</em> cases a choice is necessary between fixing bugs (or adding essential functionality) and maintaining complete backwards compatibility; in those cases, an incompatible change may be introduced. These are always discussed in detail in the <a shape="rect" href="release-notes.html">Release Notes</a> for the specific release. You should always read the release notes before attempting an upgrade, and always (really, <em>always</em>) be prepared to retest your application afterwards.</p><p>Note that you should be careful any time you make use of <strong>internal</strong> APIs (you can tell an API is internal by the package name, <code>org.apache.tapestry5.internal...</code>. Int
 ernal APIs may change <em>at any time</em>; there's no guarantee of backwards compatibility. Please always check on the documentation, or consult the user mailing list, to see if there's a stable, public alternative. If you do make use of internal APIs, be sure to get a discussion going so that your needs can be met in the future by a stable, public API.</p><p><span style="color: rgb(83,145,38);font-size: 16.0px;line-height: 1.5625;">Why are there both Request and HttpServletRequest?</span></p><p>Tapestry's Request interface is <em>very</em> close to the standard HttpServletRequest interface. It differs in a few ways, omitting some unneeded methods, and adding a couple of new methods (such as <code>isXHR()</code>), as well as changing how some existing methods operate. For example, <code>getParameterNames()</code> returns a sorted List of Strings; HttpServletRequest returns an Enumeration, which is a very dated approach.</p><p>However, the stronger reason for Request (and the relate
 d interfaces Response and Session) is to enable the support for Portlets at some point in the future. By writing code in terms of Tapestry's Request, and not HttpServletRequest, you can be assured that the same code will operate in both Servlet Tapestry and Portlet Tapestry.</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/getting-started.html
==============================================================================
--- websites/production/tapestry/content/getting-started.html (original)
+++ websites/production/tapestry/content/getting-started.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"/>
 
@@ -157,7 +167,7 @@ Application 'app' (version 1.0-SNAPSHOT-
 [INFO] Started Jetty Server
 
 </pre>
-</div></div><p>After some more one-time downloads you can open your browser to <a shape="rect" class="external-link" href="http://localhost:8080/newapp" >http://localhost:8080/newapp</a> to see the application running:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" height="488" width="500" src="getting-started.data/newapp_Index.png" data-image-src="/confluence/download/attachments/23334911/newapp_Index.png?version=1&amp;modificationDate=1428074330000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="55476322" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="newapp_Index.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23334911" data-linked-resource-container-version="57"></spa
 n></p><p>The application consists of three pages sharing a common look and feel. The initial page, Index, allows you to perform some basic operations.</p><p>You can also load the newly-created project it into any IDE and start coding. See the next section on where to find the different components of the application.</p><h2 id="GettingStarted-Exploringthegeneratedproject">Exploring the generated project</h2><p>The archetype creates the following files:</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+</div></div><p>After some more one-time downloads you can open your browser to <a shape="rect" class="external-link" href="http://localhost:8080/newapp" >http://localhost:8080/newapp</a> to see the application running:</p><p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-content-image-border image-center" height="488" width="500" src="getting-started.data/newapp_Index.png"></span></p><p>The application consists of three pages sharing a common look and feel. The initial page, Index, allows you to perform some basic operations.</p><p>You can also load the newly-created project it into any IDE and start coding. See the next section on where to find the different components of the application.</p><h2 id="GettingStarted-Exploringthegeneratedproject">Exploring the generated project</h2><p>The archetype creates the following files:</p><div class="preformatted panel" style="border-width: 1p
 x;"><div class="preformattedContent panelContent">
 <pre>newapp/
 &#9500;&#9472;&#9472; build.gradle
 &#9500;&#9472;&#9472; gradle

Modified: websites/production/tapestry/content/hibernate-core-conf.html
==============================================================================
--- websites/production/tapestry/content/hibernate-core-conf.html (original)
+++ websites/production/tapestry/content/hibernate-core-conf.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"/>
 
@@ -69,11 +79,11 @@
 <p>One way to configure hibernate is to create a <code>hibernate.cfg.xml</code> file and place it in the root of your application (i.e., under src/main/resources). Most Hibernate-specific configuration occurs in this file. Another way is to contribute objects that perform configuration (such as setting event listeners). 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 static void contributeHibernateSessionSource(OrderedConfiguration&lt;HibernateConfigurer&gt; config)
 {
-  config.add(&quot;Widget&quot;, new WidgetHibernateConfigurer());
-}]]></script>
+  config.add("Widget", new WidgetHibernateConfigurer());
+}</pre>
 </div></div>
 
 <p>Note that the configuration is an OrderedConfiguration. The library contributes two configurers by default:</p>
@@ -95,11 +105,11 @@ public static void contributeHibernateSe
 <p>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 static void contributeHibernateEntityPackageManager(Configuration&lt;String&gt; configuration)
 {
-  configuration.add(&quot;org.example.myapp.domain&quot;);
-}]]></script>
+  configuration.add("org.example.myapp.domain");
+}</pre>
 </div></div>
 
 <p>You may add as many packages in this manner as you wish. This option is most often used when the entities themselves are contained in a library included within an application, rather than part of the application directly.</p>

Modified: websites/production/tapestry/content/hibernate-core.html
==============================================================================
--- websites/production/tapestry/content/hibernate-core.html (original)
+++ websites/production/tapestry/content/hibernate-core.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/hibernate-statistics.html
==============================================================================
--- websites/production/tapestry/content/hibernate-statistics.html (original)
+++ websites/production/tapestry/content/hibernate-statistics.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,27 +75,27 @@
 <p>If you enable Hibernate statistics by setting the property <em>hibernate.generate_statistics</em> to <em>true</em>, Hibernate will expose a number of useful metrics. The page "Statistics" is used to expose these metrics. This page is only available in development mode.</p>
 
 
-<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="hibernate-statistics.data/hibernate-statistics.png" data-image-src="/confluence/download/attachments/23338472/hibernate-statistics.png?version=1&amp;modificationDate=1293570203000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347136" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="hibernate-statistics.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23338472" data-linked-resource-container-version="17"></span></p>
+<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="hibernate-statistics.data/hibernate-statistics.png"></span></p>
 
-<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="hibernate-statistics.data/hibernate-statistics-2.png" data-image-src="/confluence/download/attachments/23338472/hibernate-statistics-2.png?version=1&amp;modificationDate=1293570203000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347137" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="hibernate-statistics-2.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23338472" data-linked-resource-container-version="17"></span></p>
+<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="hibernate-statistics.data/hibernate-statistics-2.png"></span></p>
 
 <h1 id="HibernateStatistics-HibernateConfigurationtoenabletheStatistics">Hibernate Configuration to enable the Statistics</h1>
 
 <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;">
 &lt;!DOCTYPE hibernate-configuration PUBLIC
-    &quot;-//Hibernate/Hibernate Configuration DTD//EN&quot;
-    &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
+    "-//Hibernate/Hibernate Configuration DTD//EN"
+    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
     
 &lt;hibernate-configuration&gt;
 
     ...
 
-    &lt;property name=&quot;hibernate.generate_statistics&quot;&gt;true&lt;/property&gt;
+    &lt;property name="hibernate.generate_statistics"&gt;true&lt;/property&gt;
     
   &lt;/session-factory&gt;
 
-&lt;/hibernate-configuration&gt;]]></script>
+&lt;/hibernate-configuration&gt;</pre>
 </div></div></div>
 </div>
 

Modified: websites/production/tapestry/content/hibernate-support-faq.html
==============================================================================
--- websites/production/tapestry/content/hibernate-support-faq.html (original)
+++ websites/production/tapestry/content/hibernate-support-faq.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,23 +67,7 @@
   </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="specific-errors-faq.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="specific-errors-faq.html">Specific Errors FAQ</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="frequently-asked-questions.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="frequently-asked-questions.html">Frequently Asked Questions</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="maven-support-faq.html">Maven Support FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a sha
 pe="rect" href="maven-support-faq.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><h2 id="HibernateSupportFAQ-HibernateSupport">Hibernate Support</h2><p>Main article: <a shape="rect" href="hibernate.html">Hibernate</a></p><h3 id="HibernateSupportFAQ-HowdoIgetHibernatetostartupupwhentheapplicationstartsup,ratherthanlazilywiththefirstrequestfortheapplication?">How do I get Hibernate to startup up when the application starts up, rather than lazily with the first request for the application?</h3><p>This was a minor problem in 5.0; by 5.1 it is just a matter of overriding the configuration system <code>tapestry.hibernate-early-startup</code> to "true".</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="specific-errors-faq.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="specific-errors-faq.html">Specific Errors FAQ</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="frequently-asked-questions.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="frequently-asked-questions.html">Frequently Asked Questions</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="maven-support-faq.html">Maven Support FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a sha
 pe="rect" href="maven-support-faq.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
+<div id="ConfluenceContent"><h2 id="HibernateSupportFAQ-HibernateSupport">Hibernate Support</h2><p>Main article: <a shape="rect" href="hibernate.html">Hibernate</a></p><h3 id="HibernateSupportFAQ-HowdoIgetHibernatetostartupupwhentheapplicationstartsup,ratherthanlazilywiththefirstrequestfortheapplication?">How do I get Hibernate to startup up when the application starts up, rather than lazily with the first request for the application?</h3><p>This was a minor problem in 5.0; by 5.1 it is just a matter of overriding the configuration system <code>tapestry.hibernate-early-startup</code> to "true".</p></div>
 </div>
 
 <div class="clearer"></div>