tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r958386 [3/4] - in /websites/production/tapestry/content: ./ cache/
Date Wed, 15 Jul 2015 09:20:20 GMT
Modified: websites/production/tapestry/content/request-processing.html
==============================================================================
--- websites/production/tapestry/content/request-processing.html (original)
+++ websites/production/tapestry/content/request-processing.html Wed Jul 15 09:20:19 2015
@@ -58,7 +58,7 @@
 
 <div id="content">
 <div id="ConfluenceContent"><h1 id="RequestProcessing-RequestProcessing">Request Processing</h1><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div><p>Understanding the request processing pipeline is very important, as it is one of the chief extension points for Tapestry.</p><p>Much of the early stages of processing are in the form of extensible <a shape="rect" href="pipelinebuilder-service.html">pipelines</a>.</p><h2 id="RequestProcessing-TapestryFilter">Tapestry Filter</h2><p>All incoming requests originate with the TapestryFilter, which is configured inside the application's <a shape="rect" href="configuration.html">web.xml</a>.</p><p>The TapestryFilter is responsible for a number of startup and initialization functions.</p><p>When it receives a request, the TapestryFilter obtains the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/HttpServletRequestHandler.html">Htt
 pServletRequestHandler</a> service, and invokes its service() method.</p><h2 id="RequestProcessing-HttpServletRequestHandlerPipeline">HttpServletRequestHandler Pipeline</h2><p>This pipeline performs initial processing of the request. It can be extended by contributing a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/HttpServletRequestFilter.html">HttpServletRequestFilter</a> into the HttpServletRequestHandler service's configuration.</p><p>Tapestry does not contribute any filters into this pipeline of its own.</p><p>The terminator for the pipeline does two things:</p><ul><li>It stores the request and response into the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestGlobals.html">RequestGlobals</a> service. This is a per-thread scoped service that stores per-thread/per-request information.</li><li>It wraps the request and response as a <a s
 hape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Request.html">Request</a> and <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Response.html">Response</a>, and passes them into the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestHandler.html">RequestHandler</a> pipeline.</li></ul><h2 id="RequestProcessing-RequestHandlerPipeline">RequestHandler Pipeline</h2><p>This pipeline is where most extensions related to requests take place. Request represents an abstraction on top of HttpServletRequest. (Primarily, this exists to bridge from the Servlet API objects to the corresponding Tapestry objects. This is the basis for the planned portlet integration for Tapestry.) Where other code and services within Tapestry require access to information in the request, such as query parameters, th
 at information is obtained from the Request (or Response) objects.</p><p>The RequestHandler pipeline includes a number of built-in filters:</p><ul><li>CheckForUpdates is responsible for <a shape="rect" href="class-reloading.html">class and template reloading</a>.</li><li>Localization identifies the <a shape="rect" href="localization.html">locale for the user</a>.</li><li>StaticFiles checks for URLs that are for static files (files that exist inside the web context) and aborts the request, so that the servlet container can handle the request normally.</li><li>ErrorFilter catches uncaught exceptions from the lower levels of Tapestry and presents the exception report page. This involves the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html">RequestExceptionHandler</a> service, which is responsible for initializing and rendering the <a shape="rect" class="external-link" href="http://tapestry.
 apache.org/current/apidocs/org/apache/tapestry5/corelib/pages/ExceptionReport.html">core/ExceptionReport</a> page.</li></ul><p>The terminator for this pipeline stores the Request and the Response into RequestGlobals, then requests that the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Dispatcher.html">MasterDispatcher</a> service figure out how to handle the request (if it is, indeed, a Tapestry request).</p><h2 id="RequestProcessing-MasterDispatcherService">Master Dispatcher Service</h2><p>The MasterDispatcher service is a chain-of-command, aggregating together (in a specific order), several Dispatcher objects. Each Dispatcher is built to recognize and process a particular kind of URL.</p><h3 id="RequestProcessing-RootPathDispatcher">RootPath Dispatcher</h3><p>The RootPath Dispatcher recognizes a request for the application root (i.e., "/") and handles this the same as a render request for the "Start" page. Supp
 ort for the Start page is kept for legacy purposes. Index pages are the correct approach.</p><h3 id="RequestProcessing-AssetDispatcher">Asset Dispatcher</h3><p>Requests that begin with "/assets/" are references to <a shape="rect" href="assets.html">asset resources</a> that are stored on the classpath, inside the Tapestry JARs (or perhaps inside the JAR for a component library). The contents of the file will be delivered to the client browser as a byte stream. This dispatcher also handles requests that are simply polling for a change to the file.</p><h3 id="RequestProcessing-PageRenderDispatcher">PageRender Dispatcher</h3><p>Page render requests are requests to render a particular page. Such requests may include additional elements on the path, which will be treated as activation context (see ComponentEvent Dispatcher below). Generally speaking, the activation context is the primary key of some related entity object. This allows the page to reconstruct the state it will need to succe
 ssfully render itself.</p><p>The event handler method for the activate event may return a value; this is treated the same as the return value from a component action request; typically this will result in a redirect to another page. In this way, the activate event can perform simple validation at the page level ("can the user see this page?").</p><p>Page render URLs consist of the logical name of the page plus additional path elements for the activation context. The dispatcher here strips terms off of the path until it finds a known page name. Thus, "/mypage/27" would look first for a page whose name was "mypage/27", then look for a page name "mypage". Assuming the second search was successful, the page would be activated with the context "27". If no logical page name can be identified, control passes to the next dispatcher.</p><h3 id="RequestProcessing-ComponentEventDispatcher">ComponentEvent Dispatcher</h3><p>The ComponentEvent dispatcher is used to trigger events in components.</
 p><p>The URL identifies the name of the page, then a series of component ids (the path from the page down to the specific component), then the name of the event to be triggered on the component. The remaining path elements are used as the context for the <em>event</em> (not for the page activation, which does not currently apply). For example, "/griddemo.FOO.BAR/3" would locate page "griddemo", then component "FOO.BAR", and trigger an event named "action" (the default event type, which is omitted from the URL), with the context "3".</p><p>If the page in question has an activation context, it is supplied as an additional query parameter on the link.</p><p>In cases where the event type is not the default, "action", it will appear between the nested component id and the event context, preceded by a colon. Example: "/example/foo.bar:magic/99" would trigger an event of type "magic". This is not common in the vanilla Tapestry framework, but will likely be more common as Ajax features (whi
 ch would not use the normal request logic) are implemented.</p><p>The response from a component action request is typically, but not universally, used to send a redirect to the client; the redirect URL is a page render URL to display the response to the event. This is detailed under <a shape="rect" href="page-navigation.html">Page Navigation</a>.</p><h2 id="RequestProcessing-RequestGlobalsService">RequestGlobals Service</h2><p>The RequestGlobals service has a life cycle of per-thread; this means that a separate instance exists for every thread, and therefore, for every request. The terminators of the two handler pipelines store the request/response pairs into the RequestGlobals service.</p><h2 id="RequestProcessing-RequestService">Request Service</h2><p>The Request service is a <a shape="rect" href="shadowbuilder-service.html">shadow</a> of the RequestGlobals services' request property. That is, any methods invoked on this service are delegated to the request object stored inside th
 e RequestGlobals.</p><h2 id="RequestProcessing-Overview">Overview</h2><p>The following diagram provides an overview of how the different pipelines, filters and dispatchers interact when processing an incoming request.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="request-processing.data/tapestry_request_processing_800.png" data-image-src="/confluence/download/attachments/22872133/tapestry_request_processing_800.png?version=1&amp;modificationDate=1299128361000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="25591978" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="tapestry_request_processing_800.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="22872133" data-linked-resource-container-version="25"></span></p></div>
+<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>Understanding the request processing pipeline is very important, as it is one of the chief extension points for Tapestry.</p><p>Much of the early stages of processing are in the form of extensible <a shape="rect" href="pipelinebuilder-service.html">pipelines</a>.</p><h2 id="RequestProcessing-TapestryFilter">Tapestry Filter</h2><p>All incoming requests originate with the TapestryFilter, which is configured inside the application's <a shape="rect" href="configuration.html">web.xml</a>.</p><p>The TapestryFilter is responsible for a number of startup and initialization functions.</p><p>When it receives a request, the TapestryFilter obtains the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/HttpServletRequestHandler.html">Htt
 pServletRequestHandler</a> service, and invokes its service() method.</p><h2 id="RequestProcessing-HttpServletRequestHandlerPipeline">HttpServletRequestHandler Pipeline</h2><p>This pipeline performs initial processing of the request. It can be extended by contributing a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/HttpServletRequestFilter.html">HttpServletRequestFilter</a> into the HttpServletRequestHandler service's configuration.</p><p>Tapestry does not contribute any filters into this pipeline of its own.</p><p>The terminator for the pipeline does two things:</p><ul><li>It stores the request and response into the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestGlobals.html">RequestGlobals</a> service. This is a per-thread scoped service that stores per-thread/per-request information.</li><li>It wraps the request and response as a <a s
 hape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Request.html">Request</a> and <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Response.html">Response</a>, and passes them into the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestHandler.html">RequestHandler</a> pipeline.</li></ul><h2 id="RequestProcessing-RequestHandlerPipeline">RequestHandler Pipeline</h2><p>This pipeline is where most extensions related to requests take place. Request represents an abstraction on top of HttpServletRequest. (Primarily, this exists to bridge from the Servlet API objects to the corresponding Tapestry objects. This is the basis for the planned portlet integration for Tapestry.) Where other code and services within Tapestry require access to information in the request, such as query parameters, th
 at information is obtained from the Request (or Response) objects.</p><p>The RequestHandler pipeline includes a number of built-in filters:</p><ul><li>CheckForUpdates is responsible for <a shape="rect" href="class-reloading.html">class and template reloading</a>.</li><li>Localization identifies the <a shape="rect" href="localization.html">locale for the user</a>.</li><li>StaticFiles checks for URLs that are for static files (files that exist inside the web context) and aborts the request, so that the servlet container can handle the request normally.</li><li>ErrorFilter catches uncaught exceptions from the lower levels of Tapestry and presents the exception report page. This involves the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html">RequestExceptionHandler</a> service, which is responsible for initializing and rendering the <a shape="rect" class="external-link" href="http://tapestry.
 apache.org/current/apidocs/org/apache/tapestry5/corelib/pages/ExceptionReport.html">core/ExceptionReport</a> page.</li></ul><p>The terminator for this pipeline stores the Request and the Response into RequestGlobals, then requests that the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Dispatcher.html">MasterDispatcher</a> service figure out how to handle the request (if it is, indeed, a Tapestry request).</p><h2 id="RequestProcessing-MasterDispatcherService">Master Dispatcher Service</h2><p>The MasterDispatcher service is a chain-of-command, aggregating together (in a specific order), several Dispatcher objects. Each Dispatcher is built to recognize and process a particular kind of URL.</p><h3 id="RequestProcessing-RootPathDispatcher">RootPath Dispatcher</h3><p>The RootPath Dispatcher recognizes a request for the application root (i.e., "/") and handles this the same as a render request for the "Start" page. Supp
 ort for the Start page is kept for legacy purposes. Index pages are the correct approach.</p><h3 id="RequestProcessing-AssetDispatcher">Asset Dispatcher</h3><p>Requests that begin with "/assets/" are references to <a shape="rect" href="assets.html">asset resources</a> that are stored on the classpath, inside the Tapestry JARs (or perhaps inside the JAR for a component library). The contents of the file will be delivered to the client browser as a byte stream. This dispatcher also handles requests that are simply polling for a change to the file.</p><h3 id="RequestProcessing-PageRenderDispatcher">PageRender Dispatcher</h3><p>Page render requests are requests to render a particular page. Such requests may include additional elements on the path, which will be treated as activation context (see ComponentEvent Dispatcher below). Generally speaking, the activation context is the primary key of some related entity object. This allows the page to reconstruct the state it will need to succe
 ssfully render itself.</p><p>The event handler method for the activate event may return a value; this is treated the same as the return value from a component action request; typically this will result in a redirect to another page. In this way, the activate event can perform simple validation at the page level ("can the user see this page?").</p><p>Page render URLs consist of the logical name of the page plus additional path elements for the activation context. The dispatcher here strips terms off of the path until it finds a known page name. Thus, "/mypage/27" would look first for a page whose name was "mypage/27", then look for a page name "mypage". Assuming the second search was successful, the page would be activated with the context "27". If no logical page name can be identified, control passes to the next dispatcher.</p><h3 id="RequestProcessing-ComponentEventDispatcher">ComponentEvent Dispatcher</h3><p>The ComponentEvent dispatcher is used to trigger events in components.</
 p><p>The URL identifies the name of the page, then a series of component ids (the path from the page down to the specific component), then the name of the event to be triggered on the component. The remaining path elements are used as the context for the <em>event</em> (not for the page activation, which does not currently apply). For example, "/griddemo.FOO.BAR/3" would locate page "griddemo", then component "FOO.BAR", and trigger an event named "action" (the default event type, which is omitted from the URL), with the context "3".</p><p>If the page in question has an activation context, it is supplied as an additional query parameter on the link.</p><p>In cases where the event type is not the default, "action", it will appear between the nested component id and the event context, preceded by a colon. Example: "/example/foo.bar:magic/99" would trigger an event of type "magic". This is not common in the vanilla Tapestry framework, but will likely be more common as Ajax features (whi
 ch would not use the normal request logic) are implemented.</p><p>The response from a component action request is typically, but not universally, used to send a redirect to the client; the redirect URL is a page render URL to display the response to the event. This is detailed under <a shape="rect" href="page-navigation.html">Page Navigation</a>.</p><h2 id="RequestProcessing-RequestGlobalsService">RequestGlobals Service</h2><p>The RequestGlobals service has a life cycle of per-thread; this means that a separate instance exists for every thread, and therefore, for every request. The terminators of the two handler pipelines store the request/response pairs into the RequestGlobals service.</p><h2 id="RequestProcessing-RequestService">Request Service</h2><p>The Request service is a <a shape="rect" href="shadowbuilder-service.html">shadow</a> of the RequestGlobals services' request property. That is, any methods invoked on this service are delegated to the request object stored inside th
 e RequestGlobals.</p><h2 id="RequestProcessing-Overview">Overview</h2><p>The following diagram provides an overview of how the different pipelines, filters and dispatchers interact when processing an incoming request.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="request-processing.data/tapestry_request_processing_800.png" data-image-src="/confluence/download/attachments/22872133/tapestry_request_processing_800.png?version=1&amp;modificationDate=1299128361000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="25591978" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="tapestry_request_processing_800.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="22872133" data-linked-resource-container-version="26"></span></p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/session-storage.html
==============================================================================
--- websites/production/tapestry/content/session-storage.html (original)
+++ websites/production/tapestry/content/session-storage.html Wed Jul 15 09:20:19 2015
@@ -61,11 +61,11 @@
 <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>Ordinary <a shape="rect" href="persistent-page-data.html">page-persistent fields</a> won't work for this, since persistent fields are available only to a specific page, not shared across multiple pages.</p><p>Tapestry provides two mechanisms for storing such data: Session State Objects and Session Attributes. When deciding between the two, it's best to use Session State Objects for complex objects, and Session Attributes for simple types.</p><h2 id="SessionStorage-SessionStateObjects">Session State Objects</h2><p>With a Session State Object (SSO), the value is automatically stored outside the page; with the default storage strategy, it is stored in the session. Such a value is global to all pages <em>for the same user</em>, but is stored separately for different users.</p><p>A field holdin
 g an SSO is marked with the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SessionState.html">SessionState</a> annotation.</p><div class="navmenu" style="float:right; background:white; margin:3px; padding:3px">
 <div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>Contents</b></div><div class="panelContent">
 <style type="text/css">/*<![CDATA[*/
-div.rbtoc1435440031256 {padding: 0px;}
-div.rbtoc1435440031256 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1435440031256 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1436951978710 {padding: 0px;}
+div.rbtoc1436951978710 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1436951978710 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1435440031256">
+/*]]>*/</style><div class="toc-macro rbtoc1436951978710">
 <ul class="toc-indentation"><li><a shape="rect" href="#SessionStorage-SessionStateObjects">Session State Objects</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#SessionStorage-Pitfalls">Pitfalls</a></li><li><a shape="rect" href="#SessionStorage-CheckforCreation">Check for Creation</a></li><li><a shape="rect" href="#SessionStorage-PersistenceStrategies">Persistence Strategies</a></li><li><a shape="rect" href="#SessionStorage-ConfiguringSSOs">Configuring SSOs</a></li></ul>
 </li><li><a shape="rect" href="#SessionStorage-SessionAttributes">Session Attributes</a>

Modified: websites/production/tapestry/content/specific-errors-faq.html
==============================================================================
--- websites/production/tapestry/content/specific-errors-faq.html (original)
+++ websites/production/tapestry/content/specific-errors-faq.html Wed Jul 15 09:20:19 2015
@@ -65,7 +65,7 @@ table.ScrollbarTable td.ScrollbarParent
 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="limitations.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="limitations.html">Limitations</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="hibernate-support-faq.html">Hibernate Support FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="
 hibernate-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="SpecificErrorsFAQ-SpecificErrors">Specific Errors</h2><h3 id="SpecificErrorsFAQ-WhydoIgettheexception&quot;Noserviceimplementstheinterfaceorg.apache.tapestry5.internal.InternalComponentResources&quot;whentryingtousetheBeanEditFormcomponent?">Why do I get the exception "No service implements the interface org.apache.tapestry5.internal.InternalComponentResources" when trying to use the BeanEditForm component?</h3><p>This can occur when you choose the wrong package for your data object, the object edited by the BeanEditForm component. If you place it in the same package as your pages, Tapestry will treat it like a page, and perform a number of transformation on it, including adding a new constructor.</p><p>Only component classes should go in the Tapestry-controlled packages (<code>pages</code>, <code>co
 mponents</code>, <code>mixins</code> and <code>base</code> under your application's root package). By convention, simple data objects should go in a <code>data</code> package, and Hibernate entities should go in an <code>entities</code> package.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This is likely a bit different in 5.3 than in 5.2 (because 5.3 builds a very different constructor into the component) and needs to be tested in 5.3 to see what exact exception will occur.</p></div></div><h3 id="SpecificErrorsFAQ-Igetanerrorabout&quot;Pagedidnotgenerateanymarkupwhenrendered.&quot;butIhaveatemplate,whathappened?">I get an error about "Page did not generate any markup when rendered." but I have a template, what happened?</h3><p>The most common error here is that the case of the page class did not match
  the case of the template. For example, you might name your class ViewOrders, but name the template vieworders.tml. The correct name for the template is ViewOrders.tml, matching the case of the Java class name.</p><p>Worse, you may find that your application works during development (under Windows, which is case insensitive) but does not work when deployed on a Linux or Unix server, which may be case sensitive.</p><p>The other cause of this may be that your template files simply are not being packaged up correctly with the rest of your application. When in doubt, use the Java <code>jar</code> command to see exactly whats inside your WAR file. Your page templates should either be in the root folder of the WAR, or package with the corresponding .class file.</p><h3 id="SpecificErrorsFAQ-MyapplicationfailswiththeerrorPermGen,howdoIfixthis?">My application fails with the error <strong>PermGen</strong>, how do I fix this?</h3><p>PermGen refers to the part of the Java memory space devoted 
 to permanent objects, which are mostly loaded classes. When developing under Tapestry, many more classes and class loaders are created than normal; this is part of live class reloading. Because of this, you will want to increase the amount of memory Java devotes to this.</p><p>The solution is to add <code>-XX:MaxPermSize=512m</code> to your command line. You may also want to increase the regular amount of heap space with <code>-Xmx600M</code>. Of course, you may need to adjust the amount of memory in each category to match your actual application, but these are good starting values.</p><p>Java Virtual Machine arguments can be specified inside an Eclipse launch configuration:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail" src="specific-errors-faq.thumbs/eclipse-permgen.png" data-image-src="/confluence/download/attachments/23334931/eclipse-permgen.png?version=1&amp;modificationDate=1293463219000&amp;api=v2" data-unresol
 ved-comment-count="0" data-linked-resource-id="24347132" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="eclipse-permgen.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23334931" data-linked-resource-container-version="26"></span></p><h3 id="SpecificErrorsFAQ-WhydoIsometimesgetajava.lang.NoSuchMethodErrorexceptionafterreloadingmypage?">Why do I sometimes get a <code>java.lang.NoSuchMethodError</code> exception after reloading my page?</h3><p>Tapestry's live class reloading is not perfect.&#160;<span style="line-height: 1.4285715;">It tends to use a lot of Java ClassLoaders on top of the normal ClassLoaders used by the Java Virtual Machine and the servlet container. When you change non-component classes and interfaces that are referenced by components and pages, such as to add or change a method, only the component classes are reloaded.
  The non-component classes are frozen as they were when they were </span><em style="line-height: 1.4285715;">first</em><span style="line-height: 1.4285715;"> loaded.</span></p><p>Unfortunately, this is one of the areas where you must restart your application entirely in order to force the new versions of the non-component classes to be loaded into memory.</p><p>&#160;</p><style type="text/css">/*<![CDATA[*/
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="limitations.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="limitations.html">Limitations</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="hibernate-support-faq.html">Hibernate Support FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="
 hibernate-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="SpecificErrorsFAQ-SpecificErrors">Specific Errors</h2><h3 id="SpecificErrorsFAQ-WhydoIgettheexception&quot;Noserviceimplementstheinterfaceorg.apache.tapestry5.internal.InternalComponentResources&quot;whentryingtousetheBeanEditFormcomponent?">Why do I get the exception "No service implements the interface org.apache.tapestry5.internal.InternalComponentResources" when trying to use the BeanEditForm component?</h3><p>This can occur when you choose the wrong package for your data object, the object edited by the BeanEditForm component. If you place it in the same package as your pages, Tapestry will treat it like a page, and perform a number of transformation on it, including adding a new constructor.</p><p>Only component classes should go in the Tapestry-controlled packages (<code>pages</code>, <code>co
 mponents</code>, <code>mixins</code> and <code>base</code> under your application's root package). By convention, simple data objects should go in a <code>data</code> package, and Hibernate entities should go in an <code>entities</code> package.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This is likely a bit different in 5.3 than in 5.2 (because 5.3 builds a very different constructor into the component) and needs to be tested in 5.3 to see what exact exception will occur.</p></div></div><h3 id="SpecificErrorsFAQ-Igetanerrorabout&quot;Pagedidnotgenerateanymarkupwhenrendered.&quot;butIhaveatemplate,whathappened?">I get an error about "Page did not generate any markup when rendered." but I have a template, what happened?</h3><p>The most common error here is that the case of the page class did not match
  the case of the template. For example, you might name your class ViewOrders, but name the template vieworders.tml. The correct name for the template is ViewOrders.tml, matching the case of the Java class name.</p><p>Worse, you may find that your application works during development (under Windows, which is case insensitive) but does not work when deployed on a Linux or Unix server, which may be case sensitive.</p><p>The other cause of this may be that your template files simply are not being packaged up correctly with the rest of your application. When in doubt, use the Java <code>jar</code> command to see exactly whats inside your WAR file. Your page templates should either be in the root folder of the WAR, or package with the corresponding .class file.</p><h3 id="SpecificErrorsFAQ-MyapplicationfailswiththeerrorPermGen,howdoIfixthis?">My application fails with the error <strong>PermGen</strong>, how do I fix this?</h3><p>PermGen refers to the part of the Java memory space devoted 
 to permanent objects, which are mostly loaded classes. When developing under Tapestry, many more classes and class loaders are created than normal; this is part of live class reloading. Because of this, you will want to increase the amount of memory Java devotes to this.</p><p>The solution is to add <code>-XX:MaxPermSize=512m</code> to your command line. You may also want to increase the regular amount of heap space with <code>-Xmx600M</code>. Of course, you may need to adjust the amount of memory in each category to match your actual application, but these are good starting values.</p><p>Java Virtual Machine arguments can be specified inside an Eclipse launch configuration:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail" src="specific-errors-faq.thumbs/eclipse-permgen.png" data-image-src="/confluence/download/attachments/23334931/eclipse-permgen.png?version=1&amp;modificationDate=1293463219000&amp;api=v2" data-unresol
 ved-comment-count="0" data-linked-resource-id="24347132" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="eclipse-permgen.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23334931" data-linked-resource-container-version="27"></span></p><h3 id="SpecificErrorsFAQ-WhydoIsometimesgetajava.lang.NoSuchMethodErrorexceptionafterreloadingmypage?">Why do I sometimes get a <code>java.lang.NoSuchMethodError</code> exception after reloading my page?</h3><p>Tapestry's live class reloading is not perfect.&#160;<span style="line-height: 1.4285715;">It tends to use a lot of Java ClassLoaders on top of the normal ClassLoaders used by the Java Virtual Machine and the servlet container. When you change non-component classes and interfaces that are referenced by components and pages, such as to add or change a method, only the component classes are reloaded.
  The non-component classes are frozen as they were when they were </span><em style="line-height: 1.4285715;">first</em><span style="line-height: 1.4285715;"> loaded.</span></p><p>Unfortunately, this is one of the areas where you must restart your application entirely in order to force the new versions of the non-component classes to be loaded into memory.</p><p>&#160;</p><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;}

Modified: websites/production/tapestry/content/tapestry-ioc-overview.html
==============================================================================
--- websites/production/tapestry/content/tapestry-ioc-overview.html (original)
+++ websites/production/tapestry/content/tapestry-ioc-overview.html Wed Jul 15 09:20:19 2015
@@ -105,7 +105,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 
 <p>So the IoC container is the "town" and in the world of the IoC container, everything has a name, a place, and a relationship to everything else in the container. Tapestry calls this world "The Registry".</p>
 
-<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="tapestry-ioc-overview.data/ioc-overview.png" data-image-src="/confluence/download/attachments/23338486/ioc-overview.png?version=1&amp;modificationDate=1290980234000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346936" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="ioc-overview.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23338486" data-linked-resource-container-version="22"></span></p>
+<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="tapestry-ioc-overview.data/ioc-overview.png" data-image-src="/confluence/download/attachments/23338486/ioc-overview.png?version=1&amp;modificationDate=1290980234000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346936" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="ioc-overview.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23338486" data-linked-resource-container-version="23"></span></p>
 
 <p>Here we're seeing a few services from the built-in Tapestry IoC module, and a few of the services from the Tapestry web framework module. In fact, there are over 100 services, all interrelated, in the Registry ... and that's before you add your own to the mix. The IoC Registry treats all the services uniformly, regardless of whether they are part of Tapestry, or part of your application, or part of an add-on library.</p>
 

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 Wed Jul 15 09:20:19 2015
@@ -117,7 +117,7 @@ table.ScrollbarTable td.ScrollbarParent
 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="general-questions.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="general-questions.html">General Questions</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="page-and-component-classes-faq.html">Page And Component Classes FAQ</a></td><td colspan="1" rowspan="1" class="Scrol
 lbarNextIcon"><a shape="rect" href="page-and-component-classes-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><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p><table class="Footnotes" style="width: 100%; border:none;" cellspacing="0" cellpadding="0" summary="This table contains one or more notes for references made elsewhere on the page."><caption class="accessibility">Footnotes</caption><thead class="accessibility"><tr class="accessibility"><th colspan="1" rowspan="1" class="accessibility" id="footnote-th1">Reference</th><th colspan="1" rowspan="1" class="accessibility" id="footnote-th2">Notes</th></tr></thead><tbody></tbody></table></p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="general-questions.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="general-questions.html">General Questions</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="page-and-component-classes-faq.html">Page And Component Classes FAQ</a></td><td colspan="1" rowspan="1" class="Scrol
 lbarNextIcon"><a shape="rect" href="page-and-component-classes-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><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p></p><p><table class="Footnotes" style="width: 100%; border:none;" cellspacing="0" cellpadding="0" summary="This table contains one or more notes for references made elsewhere on the page."><caption class="accessibility">Footnotes</caption><thead class="accessibility"><tr class="accessibility"><th colspan="1" rowspan="1" class="accessibility" id="footnote-th1">Reference</th><th colspan="1" rowspan="1" class="accessibility" id="footnote-th2">Notes</th></tr></thead><tbody></tbody></table></p><p></p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/test-page-2.html
==============================================================================
--- websites/production/tapestry/content/test-page-2.html (original)
+++ websites/production/tapestry/content/test-page-2.html Wed Jul 15 09:20:19 2015
@@ -101,7 +101,7 @@
 <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>
 
 <hr>
-<p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p><table class="Footnotes" style="width: 100%; border:none;" cellspacing="0" cellpadding="0" summary="This table contains one or more notes for references made elsewhere on the page."><caption class="accessibility">Footnotes</caption><thead class="accessibility"><tr class="accessibility"><th colspan="1" rowspan="1" class="accessibility" id="footnote-th1">Reference</th><th colspan="1" rowspan="1" class="accessibility" id="footnote-th2">Notes</th></tr></thead><tbody></tbody></table></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></div>
+<p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p><table class="Footnotes" style="width: 100%; border:none;" cellspacing="0" cellpadding="0" summary="This table contains one or more notes for references made elsewhere on the page."><caption class="accessibility">Footnotes</caption><thead class="accessibility"><tr class="accessibility"><th colspan="1" rowspan="1" class="accessibility" id="footnote-th1">Reference</th><th colspan="1" rowspan="1" class="accessibility" id="footnote-th2">Notes</th></tr></thead><tbody></tbody></table></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/type-coercion.html
==============================================================================
--- websites/production/tapestry/content/type-coercion.html (original)
+++ websites/production/tapestry/content/type-coercion.html Wed Jul 15 09:20:19 2015
@@ -67,7 +67,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 
 /*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="service-serialization.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="service-serialization.html">Service Serialization</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.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="ioc.html">IoC</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="starting-the-ioc-registry.html">Starting the IoC Registry</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="starting-the-ioc-registry.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 class="navmenu" style="float:right; background:white; margin:3px; padding:3px">
 <div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px"></div> 
-<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><strong>Type Coercion</strong> is the conversion of one type of object to a new object of a different type with similar content. Tapestry frequently must coerce objects from one type to another. A common example is the coercion of a string into an integer or a double.</p><p>Although type coercions happen more inside tapestry-core (including <a shape="rect" href="parameter-type-coercion.html">coercions of <span class="confluence-link">component parameters</span></a><span class="confluence-link">&#160;</span>), they may also happen inside tapestry-ioc, such as when injecting a value, rather than a service, into a builder method.</p><p>Like everything else in Tapestry, type coercions are extensible. At the root is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/curr
 ent/apidocs/org/apache/tapestry5/ioc/services/TypeCoercer.html">TypeCoercer</a> service. Its configuration consists of a number of <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/CoercionTuple.html">CoercionTuples</a>. Each tuple defines how to coerce from one type to another. The initial set of coercions is focused primarily on coercions between different numeric types:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="type-coercion.data/type-coercer.png" data-image-src="/confluence/download/attachments/23338478/type-coercer.png?version=1&amp;modificationDate=1290973716000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346935" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="type-coercer.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="im
 age/png" data-linked-resource-container-id="23338478" data-linked-resource-container-version="28"></span></p><h2 id="TypeCoercion-DefaultTypeCoercions">Default Type Coercions</h2><p>There are a few special coercions related to <code>null</code> there; <code>Object</code> --&gt; <code>List</code> wraps a lone object as a singleton list, we then need <code>null</code> --&gt; <code>List</code> to ensure that <code>null</code> stays <code>null</code> (rather than a singleton list whose lone element is a <code>null</code>).</p><p>Tapestry can <em>interpolate</em> necessary coercions. For example, say it is necessary to coerce a <code>StringBuffer</code> to an <code>Integer</code>; the TypeCoercer service will chain together a series of coercions:</p><ul><li><code>Object</code> --&gt; <code>String</code></li><li><code>String</code> --&gt; <code>Long</code></li><li><code>Long</code> --&gt; <code>Integer</code></li></ul><h2 id="TypeCoercion-Coercingfromnull">Coercing from null</h2><p>Coerci
 ng from <code>null</code> is special; it is not a spanning search as with the other types. Either there is a specific coercion from <code>null</code> to the desired type, or no coercion takes places (and the coerced value is <code>null</code>).</p><p>The only built-in <code>null</code> coercion is from <code>null</code> to <code>boolean</code> (which is always false).</p><h2 id="TypeCoercion-ListofCoercions">List of Coercions</h2><p>As of Tapestry versions 5.1 and 5.2, the following coercions are available:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<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><strong>Type Coercion</strong> is the conversion of one type of object to a new object of a different type with similar content. Tapestry frequently must coerce objects from one type to another. A common example is the coercion of a string into an integer or a double.</p><p>Although type coercions happen more inside tapestry-core (including <a shape="rect" href="parameter-type-coercion.html">coercions of <span class="confluence-link">component parameters</span></a><span class="confluence-link">&#160;</span>), they may also happen inside tapestry-ioc, such as when injecting a value, rather than a service, into a builder method.</p><p>Like everything else in Tapestry, type coercions are extensible. At the root is the <a shape="rect" class="external-link" href="http://tapestry.apache.org/curr
 ent/apidocs/org/apache/tapestry5/ioc/services/TypeCoercer.html">TypeCoercer</a> service. Its configuration consists of a number of <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/CoercionTuple.html">CoercionTuples</a>. Each tuple defines how to coerce from one type to another. The initial set of coercions is focused primarily on coercions between different numeric types:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="type-coercion.data/type-coercer.png" data-image-src="/confluence/download/attachments/23338478/type-coercer.png?version=1&amp;modificationDate=1290973716000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24346935" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="type-coercer.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="im
 age/png" data-linked-resource-container-id="23338478" data-linked-resource-container-version="29"></span></p><h2 id="TypeCoercion-DefaultTypeCoercions">Default Type Coercions</h2><p>There are a few special coercions related to <code>null</code> there; <code>Object</code> --&gt; <code>List</code> wraps a lone object as a singleton list, we then need <code>null</code> --&gt; <code>List</code> to ensure that <code>null</code> stays <code>null</code> (rather than a singleton list whose lone element is a <code>null</code>).</p><p>Tapestry can <em>interpolate</em> necessary coercions. For example, say it is necessary to coerce a <code>StringBuffer</code> to an <code>Integer</code>; the TypeCoercer service will chain together a series of coercions:</p><ul><li><code>Object</code> --&gt; <code>String</code></li><li><code>String</code> --&gt; <code>Long</code></li><li><code>Long</code> --&gt; <code>Integer</code></li></ul><h2 id="TypeCoercion-Coercingfromnull">Coercing from null</h2><p>Coerci
 ng from <code>null</code> is special; it is not a spanning search as with the other types. Either there is a specific coercion from <code>null</code> to the desired type, or no coercion takes places (and the coerced value is <code>null</code>).</p><p>The only built-in <code>null</code> coercion is from <code>null</code> to <code>boolean</code> (which is always false).</p><h2 id="TypeCoercion-ListofCoercions">List of Coercions</h2><p>As of Tapestry versions 5.1 and 5.2, the following coercions are available:</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[Double --&gt; Float
 Float --&gt; Double
 Long --&gt; Boolean

Modified: websites/production/tapestry/content/using-beaneditform-to-create-user-forms.html
==============================================================================
--- websites/production/tapestry/content/using-beaneditform-to-create-user-forms.html (original)
+++ websites/production/tapestry/content/using-beaneditform-to-create-user-forms.html Wed Jul 15 09:20:19 2015
@@ -138,20 +138,20 @@ address/CreateAddress: com.example.tutor
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    @Property
     private Address address;
 ]]></script>
-</div></div><p>When you refresh the page, you may see a warning like the following at the top of the page:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="using-beaneditform-to-create-user-forms.data/hmac-warning.png" data-image-src="/confluence/download/attachments/23340431/hmac-warning.png?version=2&amp;modificationDate=1416883285000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="49184896" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="hmac-warning.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span></p><p>If you see that, it means you need to invent an HMAC passphrase for your app. Just edit your AppModule.java class (in your services package), adding a couple of lines to the contributeApplicationDefault
 s method like the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>When you refresh the page, you may see a warning like the following at the top of the page:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="using-beaneditform-to-create-user-forms.data/hmac-warning.png" data-image-src="/confluence/download/attachments/23340431/hmac-warning.png?version=2&amp;modificationDate=1416883285000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="49184896" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="hmac-warning.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span></p><p>If you see that, it means you need to invent an HMAC passphrase for your app. Just edit your AppModule.java class (in your services package), adding a couple of lines to the contributeApplicationDefault
 s method like the following:</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[        // Set the HMAC pass phrase to secure object data serialized to client
         configuration.add(SymbolConstants.HMAC_PASSPHRASE, &quot;&quot;);]]></script>
-</div></div><p>but, instead of an empty string, insert a long, <strong>random string of characters</strong> (like a very long and complex password, at least 30 characters) that you keep private.</p><p>After you do that, stop the app and restart it, and click on the Create new address link again, and you'll see something like this:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="using-beaneditform-to-create-user-forms.data/create-address-initial.png" data-image-src="/confluence/download/attachments/23340431/create-address-initial.png?version=2&amp;modificationDate=1416884366000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347017" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="create-address-initial.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data
 -linked-resource-container-version="43"></span></p><p>Tapestry has done quite a bit of work here. It has created a form that includes a field for each property. Further, it has seen that the honorific property is an enumerated type, and presented that as a drop-down list.</p><p>In addition, Tapestry has converted the property names ("city", "email", "firstName") to user presentable labels ("City", "Email", "First Name"). In fact, these are &lt;label&gt; elements, so clicking a label with the mouse will move the input cursor into the corresponding field.</p><p>This is an awesome start; it's a presentable interface, quite nice in fact for a few minute's work. But it's far from perfect; let's get started with some customizations.</p><h1 id="UsingBeanEditFormToCreateUserForms-ChangingFieldOrder">Changing Field Order</h1><p>The BeanEditForm must guess at the right order to present the fields; for public fields, they end up in alphabetical order. For standard JavaBeans properties, the Bea
 nEditForm default is in the order in which the getter methods are defined in the class (it uses line number information, if available).</p><p>A better order for these fields is the order in which they are defined in the Address class:</p><ul><li>honorific</li><li>firstName</li><li>lastName</li><li>street1</li><li>street2</li><li>city</li><li>state</li><li>zip</li><li>email</li><li>phone</li></ul><p>We can accomplish this by using the <code>reorder</code> parameter of the BeanEditForm component, which is a comma separated list of property (or public field) names:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>CreateAddress.tml (partial)</b></div><div class="codeContent panelContent pdl">
+</div></div><p>but, instead of an empty string, insert a long, <strong>random string of characters</strong> (like a very long and complex password, at least 30 characters) that you keep private.</p><p>After you do that, stop the app and restart it, and click on the Create new address link again, and you'll see something like this:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="using-beaneditform-to-create-user-forms.data/create-address-initial.png" data-image-src="/confluence/download/attachments/23340431/create-address-initial.png?version=2&amp;modificationDate=1416884366000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347017" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="create-address-initial.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data
 -linked-resource-container-version="44"></span></p><p>Tapestry has done quite a bit of work here. It has created a form that includes a field for each property. Further, it has seen that the honorific property is an enumerated type, and presented that as a drop-down list.</p><p>In addition, Tapestry has converted the property names ("city", "email", "firstName") to user presentable labels ("City", "Email", "First Name"). In fact, these are &lt;label&gt; elements, so clicking a label with the mouse will move the input cursor into the corresponding field.</p><p>This is an awesome start; it's a presentable interface, quite nice in fact for a few minute's work. But it's far from perfect; let's get started with some customizations.</p><h1 id="UsingBeanEditFormToCreateUserForms-ChangingFieldOrder">Changing Field Order</h1><p>The BeanEditForm must guess at the right order to present the fields; for public fields, they end up in alphabetical order. For standard JavaBeans properties, the Bea
 nEditForm default is in the order in which the getter methods are defined in the class (it uses line number information, if available).</p><p>A better order for these fields is the order in which they are defined in the Address class:</p><ul><li>honorific</li><li>firstName</li><li>lastName</li><li>street1</li><li>street2</li><li>city</li><li>state</li><li>zip</li><li>email</li><li>phone</li></ul><p>We can accomplish this by using the <code>reorder</code> parameter of the BeanEditForm component, which is a comma separated list of property (or public field) names:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>CreateAddress.tml (partial)</b></div><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;t:beaneditform object=&quot;address&quot;
         reorder=&quot;honorific,firstName,lastName,street1,street2,city,state,zip,email,phone&quot; /&gt;
 ]]></script>
-</div></div><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="using-beaneditform-to-create-user-forms.data/create-address-reordered.png" data-image-src="/confluence/download/attachments/23340431/create-address-reordered.png?version=2&amp;modificationDate=1416884592000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347018" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="create-address-reordered.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span></p><h3 id="UsingBeanEditFormToCreateUserForms-Customizinglabels">Customizing labels</h3><p>Tapestry makes it pretty easy to customize the labels used on the fields. It's just a matter of creating a <em>message catalog</em> for the page.</p><p>In Tapestry, every page and
  component may have its own message catalog. This is a standard Java properties file, and it is named the same as the page or component class, with a ".properties" extension. A message catalog consists of a series of lines, each line is a message key and a message value separated with an equals sign.</p><p>All it takes is to create a message entry with a particular name: the name of the property suffixed with "-label". As elsewhere, Tapestry is forgiving of case.</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedHeader panelHeader" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/address/CreateAddress.properties</b></div><div class="preformattedContent panelContent">
+</div></div><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="using-beaneditform-to-create-user-forms.data/create-address-reordered.png" data-image-src="/confluence/download/attachments/23340431/create-address-reordered.png?version=2&amp;modificationDate=1416884592000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="24347018" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="create-address-reordered.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span></p><h3 id="UsingBeanEditFormToCreateUserForms-Customizinglabels">Customizing labels</h3><p>Tapestry makes it pretty easy to customize the labels used on the fields. It's just a matter of creating a <em>message catalog</em> for the page.</p><p>In Tapestry, every page and
  component may have its own message catalog. This is a standard Java properties file, and it is named the same as the page or component class, with a ".properties" extension. A message catalog consists of a series of lines, each line is a message key and a message value separated with an equals sign.</p><p>All it takes is to create a message entry with a particular name: the name of the property suffixed with "-label". As elsewhere, Tapestry is forgiving of case.</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedHeader panelHeader" style="border-bottom-width: 1px;"><b>src/main/resources/com/example/tutorial/pages/address/CreateAddress.properties</b></div><div class="preformattedContent panelContent">
 <pre>street1-label=Street 1
 street2-label=Street 2
 email-label=E-Mail
 zip-label=Zip Code
 phone-label=Phone Number</pre>
-</div></div><p>Since this is a <em>new</em> file (and not a change to an existing file), you may have to restart Jetty to force Tapestry to pick up the change.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v3.png" data-image-src="/confluence/download/attachments/23340431/address-v3.png?version=2&amp;modificationDate=1417055915000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527737" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v3.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span></p><p>We can also customize the options in the drop down list. All we have to do is add some more entries to the message catalog 
 matching the enum names to the desired labels. Update CreateAddress.properties and add:</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+</div></div><p>Since this is a <em>new</em> file (and not a change to an existing file), you may have to restart Jetty to force Tapestry to pick up the change.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v3.png" data-image-src="/confluence/download/attachments/23340431/address-v3.png?version=2&amp;modificationDate=1417055915000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527737" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v3.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span></p><p>We can also customize the options in the drop down list. All we have to do is add some more entries to the message catalog 
 matching the enum names to the desired labels. Update CreateAddress.properties and add:</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>MR=Mr.
 MRS=Mrs.
 DR=Dr.
@@ -160,7 +160,7 @@ DR=Dr.
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    &lt;t:beaneditform submitlabel=&quot;Create Address&quot; object=&quot;address&quot;
         reorder=&quot;honorific,firstName,lastName,street1,street2,city,state,zip,email,phone&quot;/&gt;
 ]]></script>
-</div></div><p>The default for the submitlabel parameter is "Create/Update", but here we're overriding that default to a specific value.</p><p>The final result shows the reformatting and relabelling:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v5.png" data-image-src="/confluence/download/attachments/23340431/address-v5.png?version=2&amp;modificationDate=1417055915000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527738" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v5.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span><br clear="none">Before continuing on to validation, a side note about message catalogs. M
 essage catalogs are not just for re-labeling fields and options; we'll see in later chapters how message catalogs are used in the context of localization and internationalization.</p><p>Instead of putting the label for the submit button directly inside the template, we're going to provide a reference to the label; the actual label will go in the message catalog.</p><p>In Tapestry, when binding a parameter, the value you provide may include a prefix. The prefix guides Tapestry in how to interpret the rest of the the parameter value ... is it the name of a property? The id of a component? A message key? Most parameters have a default prefix, usually "prop:", that is used when you fail to provide one (this helps to make the templates as terse as possible).</p><p>Here we want to reference a message from the catalog, so we use the "message:" prefix:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The default for the submitlabel parameter is "Create/Update", but here we're overriding that default to a specific value.</p><p>The final result shows the reformatting and relabelling:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v5.png" data-image-src="/confluence/download/attachments/23340431/address-v5.png?version=2&amp;modificationDate=1417055915000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527738" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v5.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span><br clear="none">Before continuing on to validation, a side note about message catalogs. M
 essage catalogs are not just for re-labeling fields and options; we'll see in later chapters how message catalogs are used in the context of localization and internationalization.</p><p>Instead of putting the label for the submit button directly inside the template, we're going to provide a reference to the label; the actual label will go in the message catalog.</p><p>In Tapestry, when binding a parameter, the value you provide may include a prefix. The prefix guides Tapestry in how to interpret the rest of the the parameter value ... is it the name of a property? The id of a component? A message key? Most parameters have a default prefix, usually "prop:", that is used when you fail to provide one (this helps to make the templates as terse as possible).</p><p>Here we want to reference a message from the catalog, so we use the "message:" prefix:</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:beaneditform object=&quot;address&quot; submitlabel=&quot;message:submit-label&quot;
         reorder=&quot;honorific,firstName,lastName,street1,street2,city,state,zip,email,phone&quot; /&gt;
 ]]></script>
@@ -171,14 +171,14 @@ DR=Dr.
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[    @Validate(&quot;required&quot;)
     public String firstName;
 ]]></script>
-</div></div><p>What is that string, "required"? That's how you specify the desired validation. It is a series of names that identify what type of validation is desired. A number of validators are built in, such as "required", "minLength" and "maxLength". As elsewhere, Tapestry is case insensitive.</p><p>You can apply multiple validations, by separating the validator names with commas. Some validators can be configured (with an equals sign). Thus you might say "required,minLength=5" for a field that must be specified, and must be at least five characters long.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>You can easily get confused when you make a change to an entity class, such as adding the @Validate annotation, and <em>not</em> see the result in the browser. Only component classes, and (most) classe
 s in the Tapestry services layer, are live-reloaded. Data and entity objects are not reloaded, so this is one area where you need to stop and restart Jetty to see the change.</p></div></div><p>Restart the application, and refresh your browser, then hit the Create Address button.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v6.png" data-image-src="/confluence/download/attachments/23340431/address-v6.png?version=3&amp;modificationDate=1417056607000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527739" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v6.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span></p><p>Thi
 s is a shot just after hitting the Create Address button; all the fields have been validated and errors displayed. Each field in error has been highlighted in red and had an error message added. Further, the label for each of the fields has also been highlighted in red, to even more clearly identify what's in error. The cursor has also been moved to the first field that's in error. And <em>all</em> of this is taking place on the client side, without any communication with the application.</p><p>Once all the errors are corrected, and the form does submit, all validations are performed on the server side as well (just in case the client has JavaScript disabled).</p><p>So ... how about some more interesting validation than just "required or not". Tapestry has built in support for validating based on field length and several variations of field value, including regular expressions. Zip codes are pretty easy to express as a regular expression.</p><div class="code panel pdl" style="border
 -width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>What is that string, "required"? That's how you specify the desired validation. It is a series of names that identify what type of validation is desired. A number of validators are built in, such as "required", "minLength" and "maxLength". As elsewhere, Tapestry is case insensitive.</p><p>You can apply multiple validations, by separating the validator names with commas. Some validators can be configured (with an equals sign). Thus you might say "required,minLength=5" for a field that must be specified, and must be at least five characters long.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>You can easily get confused when you make a change to an entity class, such as adding the @Validate annotation, and <em>not</em> see the result in the browser. Only component classes, and (most) classe
 s in the Tapestry services layer, are live-reloaded. Data and entity objects are not reloaded, so this is one area where you need to stop and restart Jetty to see the change.</p></div></div><p>Restart the application, and refresh your browser, then hit the Create Address button.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v6.png" data-image-src="/confluence/download/attachments/23340431/address-v6.png?version=3&amp;modificationDate=1417056607000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527739" data-linked-resource-version="3" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v6.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span></p><p>Thi
 s is a shot just after hitting the Create Address button; all the fields have been validated and errors displayed. Each field in error has been highlighted in red and had an error message added. Further, the label for each of the fields has also been highlighted in red, to even more clearly identify what's in error. The cursor has also been moved to the first field that's in error. And <em>all</em> of this is taking place on the client side, without any communication with the application.</p><p>Once all the errors are corrected, and the form does submit, all validations are performed on the server side as well (just in case the client has JavaScript disabled).</p><p>So ... how about some more interesting validation than just "required or not". Tapestry has built in support for validating based on field length and several variations of field value, including regular expressions. Zip codes are pretty easy to express as a regular expression.</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(&quot;required,regexp=^\\d{5}(-\\d{4})?$&quot;)
     public String zip;
 ]]></script>
-</div></div><p>Let's give it a try; restart the application and enter an "abc" for the zip code.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v7.png" data-image-src="/confluence/download/attachments/23340431/address-v7.png?version=2&amp;modificationDate=1417056608000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527740" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v7.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span><br clear="none">This is what you'll see after typing "abc" and clicking the Create Address button.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="a
 ui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Modern browsers will automatically validate a regexp field when the form is submitted, as shown above. Older browsers do not have that automatic support, but will still validate input, using the same decorations as for the required fields in the previous screenshot.</p></div></div><p>In any case, that's the right validation behavior, but it's the wrong message. Your users are not going to know or care about regular expressions.</p><p>Fortunately, it's easy to customize validation messages. All we need to know is the name of the property ("zip") and the name of the validator ("regexp"). We can then put an entry into the CreateAddress message catalog:</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+</div></div><p>Let's give it a try; restart the application and enter an "abc" for the zip code.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v7.png" data-image-src="/confluence/download/attachments/23340431/address-v7.png?version=2&amp;modificationDate=1417056608000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527740" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v7.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span><br clear="none">This is what you'll see after typing "abc" and clicking the Create Address button.</p><div class="confluence-information-macro confluence-information-macro-note"><span class="a
 ui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Modern browsers will automatically validate a regexp field when the form is submitted, as shown above. Older browsers do not have that automatic support, but will still validate input, using the same decorations as for the required fields in the previous screenshot.</p></div></div><p>In any case, that's the right validation behavior, but it's the wrong message. Your users are not going to know or care about regular expressions.</p><p>Fortunately, it's easy to customize validation messages. All we need to know is the name of the property ("zip") and the name of the validator ("regexp"). We can then put an entry into the CreateAddress message catalog:</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>zip-regexp-message=Zip Codes are five or nine digits.  Example: 02134 or 90125-1655.
 </pre>
-</div></div><p>Refresh the page and submit again:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v8.png" data-image-src="/confluence/download/attachments/23340431/address-v8.png?version=2&amp;modificationDate=1417056608000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527741" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v8.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="43"></span></p><p>This trick isn't limited to just the regexp validator, it works equally well with <em>any</em> validator.</p><p>Let's go one step further. Turns out, we can move the regexp pattern to the message catalog as well. If you only provide 
 the name of the validator in the @Validate annotation, Tapestry will search the containing page's message catalog of the constraint value, as well as the validation message. The constraint value for the regexp validator is the regular expression to match against.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Refresh the page and submit again:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="using-beaneditform-to-create-user-forms.data/address-v8.png" data-image-src="/confluence/download/attachments/23340431/address-v8.png?version=2&amp;modificationDate=1417056608000&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="23527741" data-linked-resource-version="2" data-linked-resource-type="attachment" data-linked-resource-default-alias="address-v8.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="23340431" data-linked-resource-container-version="44"></span></p><p>This trick isn't limited to just the regexp validator, it works equally well with <em>any</em> validator.</p><p>Let's go one step further. Turns out, we can move the regexp pattern to the message catalog as well. If you only provide 
 the name of the validator in the @Validate annotation, Tapestry will search the containing page's message catalog of the constraint value, as well as the validation message. The constraint value for the regexp validator is the regular expression to match against.</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(&quot;required,regexp&quot;)
     public String zip;
 ]]></script>



Mime
View raw message