tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r958985 [5/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/31...
Date Sun, 19 Jul 2015 21:21:30 GMT
Modified: websites/production/tapestry/content/component-cheat-sheet.html
==============================================================================
--- websites/production/tapestry/content/component-cheat-sheet.html (original)
+++ websites/production/tapestry/content/component-cheat-sheet.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,36 +67,20 @@
   </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="application-module-class-cheat-sheet.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="application-module-class-cheat-sheet.html">Application Module Class Cheat Sheet</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="cheat-sheets.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="cheat-sheets.html">Cheat Sheets</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="tapestry-for-jsf-users.html">Tapestry for JSF Users</a></td><td colspan="1" rowspan="1" class="Scroll
 barNextIcon"><a shape="rect" href="tapestry-for-jsf-users.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:#eee; margin:3px; padding:3px">
+<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>There's a lot of documentation scattered about describingthe various annotations and methods you can add to Tapestry page and component classes. This is not an <a shape="rect" href="annotations.html">exhaustive list</a>, but rather it covers some of the the more common scenarios.</p><h2 id="ComponentCheatSheet-FieldInjectionAnnotations">Field Injection Annotations</h2><p>Main articles: <a shape="rect" href="component-classes.html">Component Classes</a>, <a shape="rect" href="injection.html">Injection</a>, <a shape="rect" href="annotations.html">Annotations</a></p><h3 id="ComponentCheatSheet-@Inject">@Inject</h3><p>@Inject is the Swiss Army knife of annotations; it's designed to connect your component to services, resources, and other objects. See <a shape="rect" href="injection.html">Injec
 tion</a>.</p><h4 id="ComponentCheatSheet-ServiceInjection">Service Injection</h4><p>In most cases, the injected value is a service; the service is located by type. If there are ambiguities, caused by multiple services implementing the same interface, you'll see injection exceptions. You can resolve those exceptions by adding marker annotations to select a specific service, or by adding @Service to specify the specific service ID you want.</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>Use of @Service is discouraged. If marker annotations are available, that is preferred.</p></div></div><h3 id="ComponentCheatSheet-@InjectComponent">@InjectComponent</h3><p>Injects a component from this component's template into this component's class. Injecting a component is based on the component's ID, which should match
  the field name. However, the value attribute of the @InjectComponent annotation can be specified as well, this takes precedence over the field name.</p><p>It is common to inject a component in order to obtain its client-side ID (used when generating client-side JavaScript).</p><h3 id="ComponentCheatSheet-@InjectContainer">@InjectContainer</h3><p>Injects the container of a component or, when used in a mixin, injects the component the mixin is attached to.</p><h3 id="ComponentCheatSheet-@InjectPage">@InjectPage</h3><p>Injects a page of the application. Normally, the page to inject is identified based on the field type. The value attribute can be specified, in which case the page to be injected is identified by name.</p><h3 id="ComponentCheatSheet-@Environmental">@Environmental</h3><p>Injects an <a shape="rect" href="environmental-services.html">environmental object</a>; such objects are request scoped but may be overridden at any time using the methods of the Environment service. Env
 ironmental objects are used to allow outer components to communicate with components they enclose.</p><p>Most often, @Environmental is used with type JavaScriptSupport, which is used to add JavaScript code and libraries to the rendered page.</p><h2 id="ComponentCheatSheet-FieldBehaviorAnnotations">Field Behavior Annotations</h2><p>Main articles: <a shape="rect" href="component-classes.html">Component Classes</a>, <a shape="rect" href="annotations.html">Annotations</a></p><h3 id="ComponentCheatSheet-@PageActivationContext">@PageActivationContext</h3><p>This annotation is allowed on a <em>single</em> field; the value of the field will be included in URLs for the page as the page's activation context. This is an alternative to implementing event handler methods<br clear="none"> for the activate and passivate events directly.</p><h3 id="ComponentCheatSheet-@Parameter">@Parameter</h3><p>Marks the field as a component parameter. Attributes of the annotation allow the parameter to be marke
 d as required or optional. If the parameter value will typically be a literal string (for example, the title parameter to a Layout component), you should add <code>defaultPrefix=BindingConstants.LITERAL</code> to the annotation so that users of the component won't have to use the "literal:" binding prefix with the parameter. See <a shape="rect" href="component-parameters.html">Component Parameters</a></p><h3 id="ComponentCheatSheet-@Persist">@Persist</h3><p>Marks the field as a persistent value, one that maintains its value between requests. The default <em>strategy</em> is to simply store the value in the session (which is created as needed). Other strategies can be specified by name as the value attribute. See <a shape="rect" href="persistent-page-data.html">Persistent Page Data</a>.</p><h3 id="ComponentCheatSheet-@Property">@Property</h3><p>Directs Tapestry to automatically generate a getter and a setter for the field, converting it to a JavaBeans property than can be referenced 
 from the template.</p><h3 id="ComponentCheatSheet-@SessionState">@SessionState</h3><p>Marks the field as a Session State Object (SSO). SSOs store global data, and can be injected into any page or component. The SSOs are stored in the session, using a key based on the Java type. SSOs are usually created on demand, but the <code>create</code> attribute can turn this off. See <a shape="rect" href="session-storage.html">Session Storage</a></p><h3 id="ComponentCheatSheet-@SessionAttribute">@SessionAttribute</h3><p>In Tapestry 5.2 and later, marks the field as a Session Attribute. Like Session State Objects (SSO), a Session Attribute is stored in the session, however Session Attributes are stored by using a name you choose rather than based on the Java type. See <a shape="rect" href="session-storage.html">Session Storage</a>.</p><h3 id="ComponentCheatSheet-@ActivationRequestParameter">@ActivationRequestParameter</h3><p>Fields with this annotation will be encoded into URLs as query paramet
 ers, in much the same way as data is encoded into the URL path. The query parameter name matches the field name, unless the value attribute is specified.</p><h2 id="ComponentCheatSheet-MethodAnnotations">Method Annotations</h2><p>Main articles: <a shape="rect" href="component-classes.html">Component Classes</a>, <a shape="rect" href="annotations.html">Annotations</a></p><h3 id="ComponentCheatSheet-@OnEvent">@OnEvent</h3><p>Marks a method as an event handler method. Such methods may have any visibility, and typically use package private visibility (that is, no visibility keyword at all). By default, the method will handle the action event from any component; the value attribute controls the matched event, and the component annotation is used to limit the event source.</p><p>An event handler method may take parameters, corresponding the event context associated with the event, such as the page activation context for the activate event. The method will not be invoked if it defines more
  parameters than there are values in the context.</p><p>The @RequestParameter annotation can be used on parameters, in which case the parameters value comes from a request query parameter, and not from the event context.</p><p>Events fired on a component bubble up the component's container. Return a non-null value to cancel event bubbling. What values may be returned from an event handler method is dependent on the type of event.</p><p>You may also return true to indicate that the event is handled and bubbling should cancel (even for events that do not permit a return value).</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>An alternative to @OnEvent is the naming convention <code>on</code><em>EventName</em> or <code>on</code><em>EventName</em><code>From</code><em>ComponentId</em>.</p></div></div><h3 id="C
 omponentCheatSheet-@Log">@Log</h3><p>Marks the method to be logged for debugging purposes: method entry (with parameters) and exit (with return value) will be logged at debug level, as will any thrown exception. This is primarily for debugging purposes. The Logger name will match the component classes' fully qualified class name.</p><h3 id="ComponentCheatSheet-@CommitAfter">@CommitAfter</h3><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The support for this annotation comes from the <a shape="rect" href="hibernate.html">tapestry-hibernate</a> module or tapestry-jpa module.</p></div></div><h3 id="ComponentCheatSheet-@Cached">@Cached</h3><p>Used on methods that perform expensive operations, such as database queries. The first time such a method is invoked, the return value is cached. Future invocations of the
  same method return the cached value.</p><p>The result cache is per-request and is discarded at the end of the request.</p><p>@Cached only works on methods that take no parameters.</p><h2 id="ComponentCheatSheet-ParameterAnnotations">Parameter Annotations</h2><p>Main article: <a shape="rect" href="component-parameters.html">Component Parameters</a></p><h3 id="ComponentCheatSheet-@RequestParameter">@RequestParameter</h3><p>Used with event handler methods to get the value for the parameter from a request query parameter.</p><h2 id="ComponentCheatSheet-TypeAnnotations">Type Annotations</h2><h3 id="ComponentCheatSheet-@Events">@Events</h3><p>Lists the names of events that may be fired from within this component; used for documentation purposes only.</p><h3 id="ComponentCheatSheet-@Import">@Import</h3><p>Allows JavaScript libraries and CSS stylesheet files to be included in the rendered page. Each such file is added to the page only once, in the order in which the page renders.</p><p>It 
 is allowed to use symbol expansions (with the <code>${...</code>} syntax) inside a library or stylesheet path.</p><p>@Import may also be applied to individual methods, in which case the import operation only occurs when the method is invoked.</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>When specifying a file to import, you'll often use the prefix <code>context:</code> to indicate that the file is stored in the web application context, and not on the classpath. Relative paths will be on the classpath, relative to the Java class.</p></div></div><h3 id="ComponentCheatSheet-@SupportsInformalParameters">@SupportsInformalParameters</h3><p>Marks the component as allowing informal parameters (extra attributes in the template that do not match formally declared parameters). Normally, informal parameters are si
 mply discarded.</p><p>The method ComponentResources.renderInformalParameters() can be used to include the informal parameters within the element rendered by your component.</p><h3 id="ComponentCheatSheet-@Secure">@Secure</h3><p>Marks the page as accessible only via secure (HTTPs). Any attempt to access the page via standard HTTP will be redirected to the HTTPs version.</p><p>By default, the @Secure annotation is ignored in development mode and only active in production mode.</p><h2 id="ComponentCheatSheet-RenderPhaseMethods">Render Phase Methods</h2><p>Main article: <a shape="rect" href="component-rendering.html">Component Rendering</a></p><p>Render phase methods are close cousins to event handler methods; they are how Tapestry integrates your code into the overall rendering of the page. For each render phase, there's an annotation and corresponding naming convention to define a render phase method:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
  rowspan="1" class="confluenceTh"><p>Annotation</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Method Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>General Use</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@SetupRender</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>setupRender()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Initializes the component before rendering</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@BeginRender</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>beginRender()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Renders the element and primary attributes of the component</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@AfterRender</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>afterRender()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Closes the element started in beginRender()</p></td></
 tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@CleanupRender</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>cleanupRender()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Performs cleanup after all rendering of the component finishes</p></td></tr></tbody></table></div><p>Render phase methods either take no parameters, or take a single parameter of type MarkupWriter.</p><p>Render phase methods may return <code>void</code>, a <code>boolean</code>, or a <em>renderable object</em>.</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>Generally, a <code>renderable object</code> is a <a shape="rect" class="external-link" href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/Block.html">Block</a> or a component. The object is pushed onto the stack of rendering operat
 ions, temporarily replacing the current component as the object to be rendered.</p></div></div><p>Returning true is the same as returning void; it means that the component should follow the typical flow:</p><ul><li>@SetupRender</li><li>@BeginRender</li><li>Render the component's template, if any</li><li>Render the component's body</li><li>@AfterRender</li><li>@CleanupRender</li></ul><p>If a component has a template, the component's body will only render if the template contains a &lt;t:body&gt; element. If a component has no template, then it will always render its body (between @BeginRender and @AfterRender).</p><p>A render phase method may also return false, in which case the flow continues to an alternate render phase, as per the chart in the <a shape="rect" href="component-rendering.html">Component Rendering</a> reference page.</p><p>The most common cases:</p><ul><li>return <code>false</code> from @BeginRender to skip the rendering of the component's template and/or body, and co
 ntinue with @AfterRender</li><li>return <code>false</code> from @AfterRender to return to @BeginRender (this is used in component, such as <code>Loop</code>, that render themselves multiple times)</li></ul><h2 id="ComponentCheatSheet-PageLifeCycleMethods">Page Life Cycle Methods</h2><p>Main article: <a shape="rect" href="page-life-cycle.html">Page Life Cycle</a></p><p>Pages have a life cycle and this is represented by a <em>third</em> set of annotations or method naming conventions. Life cycle methods may appear on a page or any component of a page.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Annotation</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Method Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@PageLoaded</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>pageLoaded()</p></td><td
  colspan="1" rowspan="1" class="confluenceTd"><p>The page instance has been loaded but not yet attached for the first time.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@PageAttached</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>pageAttached()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The page is being used within a particular request. This occurs before the activate event.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@PageReset</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>pageReset()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>See notes below.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>@PageDetached</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>pageDetached()</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>End of request notification.</p></td></tr></tbody></table></div><p>Page life cycle methods may be any visibility. The
 y must take no parameters and return void.</p><p>Page life cycle methods are of lower importance starting in Tapestry 5.2, since page instances are now shared across threads, rather than pooled.</p><p>The @PageReset life cycle is new in Tapestry 5.2. It will be invoked on a page render request when linked to from some other page of the application. This is to allow the page to reset its state, if any, when a user returns to the page from some other part of the application.</p><h2 id="ComponentCheatSheet-ConfiguringAnnotations">Configuring Annotations</h2><p>The SymbolProvider service has two interfaces : FactoryDefaults and ApplicationDefaults. Tapestry provides 2 annotations in order to define which implementation you want to override in your AppModule :&#160;</p><ul><li><p>@FactoryDefaults</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AppModule with @FactoryDefaults</b></div><div class="codeCo
 ntent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[@Contribute(SymbolProvider.class)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Contribute(SymbolProvider.class)
 @FactoryDefaults
 public void setParam(MappedConfiguration&lt; String, String&gt; configuration){
-  configuration.add(SymbolConstants.PRODUCTION_MODE, &quot;false&quot;);
-}]]></script>
+  configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+}</pre>
 </div></div></li><li><p>@ApplicationDefaults</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AppModule with @ApplicationDefaults</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[@Contribute(SymbolProvider.class)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Contribute(SymbolProvider.class)
 @ApplicationDefaults
 public void setParam(MappedConfiguration&lt; String, String&gt; configuration){
-  configuration.add(SymbolConstants.PRODUCTION_MODE, &quot;false&quot;);
-}]]></script>
-</div></div></li></ul><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="application-module-class-cheat-sheet.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="application-module-class-cheat-sheet.html">Application Module Class Cheat Sheet</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="cheat-sheets.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="cheat-sheets.html">Cheat Sheets</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="tapestry-for-jsf-users.html">Tapestry for JSF Users</a></td><td colspan="1" rowspan="1" class="Scroll
 barNextIcon"><a shape="rect" href="tapestry-for-jsf-users.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>
+  configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+}</pre>
+</div></div></li></ul></div>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/component-classes.html
==============================================================================
--- websites/production/tapestry/content/component-classes.html (original)
+++ websites/production/tapestry/content/component-classes.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -59,18 +69,18 @@
 <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>A <strong>component class</strong>&#160;is the class associated with a page, component or mixin in your Tapestry web application. Classes for pages, components and mixins are all created in an identical way. They are pure POJOs (Plain Old Java Objects), typically with annotations and conventionally named methods. They are not <em>abstract</em>, nor do they need to extend base classes or implement interfaces.</p><p><em>For Tapestry 4 Users: Component classes in Tapestry 5 are much easier than in Tapestry 4. There are no base classes to extend from, the classes are concrete (not abstract), and there's no XML file. There is still a bit of configuration in the form of Java annotations, but those now go directly onto fields of your class, rather than on abstract getters and setters.</em></p><p>
 In most cases, each component class will have a corresponding <a shape="rect" href="component-templates.html">component template</a>. However, it is also possible for a component class to emit all of its markup itself, without using a template.</p><h2 id="ComponentClasses-CreatingaTrivialComponent">Creating a Trivial Component</h2><p>Creating a page or component in Tapestry 5 is a breeze. There are only a few constraints:</p><ul><li>There must be a public Java class.</li><li>The class must be in the correct package (see below).</li><li>The class must have a public, no-arguments constructor. (The default one provided by the compiler is fine.)</li></ul><p>Here's a minimal component that outputs a fixed message, using a <a shape="rect" href="component-templates.html">template</a> with a matching file name:</p><div class="sectionColumnWrapper"><div class="sectionMacro"><div class="sectionMacroRow"><div class="columnMacro"><div class="code panel pdl" style="border-width: 1px;"><div class
 ="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HelloWorld.java</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package org.example.myapp.components;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package org.example.myapp.components;
 public class HelloWorld
 {
 }
-]]></script>
+</pre>
 </div></div></div><div class="columnMacro"><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HelloWorld.tml</b></div><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;html&gt;
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;html&gt;
     Bonjour from HelloWorld component.
 &lt;/html&gt;
-]]></script>
+</pre>
 </div></div></div></div></div></div><p>In the example above, the HelloWorld class contains no code at all (except what it inherits from the Object class and what Tapestry adds invisibly).</p><p>And here's a component that does the same thing, but without needing a template:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HelloWorld.java &#8211; without a template</b></div><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package org.example.myapp.components;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package org.example.myapp.components;
 
 import org.apache.tapestry5.MarkupWriter;
 import org.apache.tapestry5.annotations.BeginRender;
@@ -80,32 +90,32 @@ public class HelloWorld
     @BeginRender
     void renderMessage(MarkupWriter writer)
     {
-        writer.write(&quot;Bonjour from HelloWorld component.&quot;);
+        writer.write("Bonjour from HelloWorld component.");
     }
 }
-]]></script>
-</div></div><p>In this example, just like the first one, the component's only job is to write out a fixed message. The @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/BeginRender.html">BeginRender</a> annotation is a type of <em><a shape="rect" href="component-rendering.html">render phase annotation</a></em>, a method annotation that instructs Tapestry when and under what circumstances to invoke methods of your class.</p><p>These methods are not necessarily public; they can have any access level you like (unlike in Tapestry 4). By convention they usually have package-private access level (the default).</p><h2 id="ComponentClasses-ComponentPackages">Component Packages</h2><p>Component classes must exist within an appropriate package (this is necessary for runtime code transformation and class reloading to operate).</p><p>These packages exist under the application's root package, as follows:</p><ul><li>For pages,
  place classes in <em>root</em>.<strong>pages</strong>. Page names are mapped to classes within this package.</li><li>For mixins, place classes in <em>root</em>.<strong>mixins</strong>. Mixin types are mapped to classes within this package.</li><li>For other components, place classes in <em>root</em>.<strong>components</strong>. Component types are mapped to classes within this package.</li></ul><p>In addition, it is common for an application to have base classes, often <em>abstract</em> base classes, that should not be directly referenced. These should <em>not</em> go in the <strong>pages</strong>, <strong>components</strong> or <strong>mixins</strong> packages, because they then look like valid pages, components or mixins. Instead, use the <em>root</em>.<strong>base</strong> package to store such base classes.</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>Only component classes should go in any of these controlled packages; classes representing data, or interfaces, or anything that isn't precisely a component class, must go elsewhere. Any top-level class in any of the controlled packages will be transformed at runtime. The only exception is inner classes<br clear="none"> (anonymous or not), which are loaded by the same class loader as the component class loader, but not transformed as components.</p></div></div><h2 id="ComponentClasses-Sub-Folders/Sub-Packages">Sub-Folders / Sub-Packages</h2><p>Classes do not have to go directly inside the package (pages, components, mixins, etc.). It is valid to create a sub-package to store some of the classes. The sub-package name becomes part of the page name or component type. Thus you might define a page component <code>com.example.myapp.pages.admin.CreateUser</code> and the logical page name (which often shows up inside URLs) will be <st
 rong>admin/CreateUser</strong>.</p><p>Tapestry performs some simple optimizations of the logical page name (or component type, or mixin type). It checks to see if the package name is either a prefix or a suffix of the unqualified class name (case insensitively, of course) and removes the prefix or suffix if so. The net result is that a class name such as <code>com.example.myapp.pages.user.EditUser</code> will have a page name of <code>user/Edit</code> (<em>not</em> <code>user/EditUser</code>). The goal here is to provide shorter, more natural URLs.</p><h2 id="ComponentClasses-IndexPages">Index Pages</h2><p>One special simplification are Index pages: if the logical page name is Index after removing the package name from the unqualified class name, it will map to the root of that folder. A class such as <code>com.example.myapp.pages.user.IndexUser</code> or <code>com.example.myapp.pages.user.UserIndex</code> will have a page name of <code>user/</code>.</p><p>In previous versions of Ta
 pestry there was also the concept of a start page configured with the <code><a shape="rect" href="configuration.html#Configuration-tapestry.startpagename">tapestry.start-page-name</a></code> configuration symbol (defaults to "start"). If a page with a name as configured with that symbol exists at the root level, this page is used as the root URL. This has precedence over an existing Index page. If for example you have a page class <code>com.example.myapp.pages.Start</code> it will map to <code>/</code>.</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>Use of start-pages is discouraged and support for it will eventually be removed. Use an Index page instead.</p></div></div><h2 id="ComponentClasses-Pagesvs.Components">Pages vs. Components</h2><p>The distinction between pages and component is very, very smal
 l. The only real difference is the package name: <em>root</em>.<strong>pages</strong>.<em>PageName</em> for pages, and <em>root</em>.<strong>components</strong>.<em>ComponentType</em> for components. Conceptually, page components are simply the <em>root component</em> of a page's component tree.</p><p><em>For Tapestry 4 users: there was a much greater distinction in Tapestry 4 between pages and components, which showed up as separate interfaces and a hierarchy of abstract implementations to extend your classes from.</em></p><h2 id="ComponentClasses-ClassTransformation">Class Transformation</h2><p>Tapestry uses your class as a starting point. It <em>transforms</em> your class at runtime. This is necessary for a number of reasons, including to address how Tapestry shares pages between requests.</p><p>For the most part, these transformations are both sensible and invisible. In a few limited cases, they are marginally <a shape="rect" class="external-link" href="http://www.joelonsoftware
 .com/printerFriendly/articles/LeakyAbstractions.html" >leaky</a> &#8211; for instance, the scope restrictions on instance variables described below &#8211; but we feel that the programming model in general will support very high levels of developer productivity.</p><p>Because transformation doesn't occur until <em>runtime</em>, the build stage of your application is not affected by the fact that you are creating a Tapestry application. Further, your classes are absolutely simple POJOs during unit testing.</p><h2 id="ComponentClasses-LiveClassReloading">Live Class Reloading</h2><p>Main Article: <a shape="rect" href="class-reloading.html">Class Reloading</a></p><p>Component classes are monitored for changes by the framework. <a shape="rect" href="class-reloading.html">Classes are reloaded when changed</a>. This allows you to build your application with a speed approaching that of a scripting environment, without sacrificing any of the power of the Java platform.</p><p>And it's fast! Y
 ou won't even notice that this magic class reloading has occurred.</p><p>The net result: super productivity &#8212; change your class, see the change instantly. This is designed to be a blend of the best of scripting environments (such as Python or Ruby) with all the speed and power of Java backing it up.</p><p>However, class reloading <em>only</em> applies to component classes and, starting in 5.2, Tapestry IOC-based service implementations (with some restrictions). Other classes, such as service interfaces, entity/model classes, and other data objects, are loaded by the normal class loader and not subject to live class reloading.</p><h2 id="ComponentClasses-InstanceVariables">Instance Variables</h2><p>Tapestry components may have instance variables (unlike Tapestry 4, where you had to use <em>abstract properties</em>).</p><p>Since release 5.3.2, instance variables may be protected, or package private (that is, no access modifier). Under specific circumstances they may even be publ
 ic (public fields must either be final, or have the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Retain.html">Retain</a>&#160;annotation).</p><p><span style="line-height: 1.4285715;">Be aware that you will need to provide getter and setter methods to access your classes' instance variables. Tapestry </span><em style="line-height: 1.4285715;">does not</em><span style="line-height: 1.4285715;"> do this automatically unless you provide the @</span><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Property.html" style="line-height: 1.4285715;">Property</a><span style="line-height: 1.4285715;"> annotation on the field.</span></p><h2 id="ComponentClasses-TransientInstanceVariables">Transient Instance Variables</h2><p>Unless an instance variable is decorated with an annotation, it will be a <em>transient</em> instance variable. This means that it
 s value resets to its default value at the end of reach request (when the <a shape="rect" href="page-life-cycle.html">page is detached from the request</a>).</p><div class="confluence-information-macro confluence-information-macro-note"><p class="title">About initialization</p><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Never initialize an instance field to a <em>mutable</em> object at the point of declaration. If this is done, the instance created from that initializer becomes the default value for that field and is reused inside the component on every request. This could cause state to inadvertently be shared between different sessions in an application.</p></div></div>
+</pre>
+</div></div><p>In this example, just like the first one, the component's only job is to write out a fixed message. The @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/BeginRender.html">BeginRender</a> annotation is a type of <em><a shape="rect" href="component-rendering.html">render phase annotation</a></em>, a method annotation that instructs Tapestry when and under what circumstances to invoke methods of your class.</p><p>These methods are not necessarily public; they can have any access level you like (unlike in Tapestry 4). By convention they usually have package-private access level (the default).</p><h2 id="ComponentClasses-ComponentPackages">Component Packages</h2><p>Component classes must exist within an appropriate package (this is necessary for runtime code transformation and class reloading to operate).</p><p>These packages exist under the application's root package, as follows:</p><ul><li>For pages,
  place classes in <em>root</em>.<strong>pages</strong>. Page names are mapped to classes within this package.</li><li>For mixins, place classes in <em>root</em>.<strong>mixins</strong>. Mixin types are mapped to classes within this package.</li><li>For other components, place classes in <em>root</em>.<strong>components</strong>. Component types are mapped to classes within this package.</li></ul><p>In addition, it is common for an application to have base classes, often <em>abstract</em> base classes, that should not be directly referenced. These should <em>not</em> go in the <strong>pages</strong>, <strong>components</strong> or <strong>mixins</strong> packages, because they then look like valid pages, components or mixins. Instead, use the <em>root</em>.<strong>base</strong> package to store such base classes.</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>Only component classes should go in any of these controlled packages; classes representing data, or interfaces, or anything that isn't precisely a component class, must go elsewhere. Any top-level class in any of the controlled packages will be transformed at runtime. The only exception is inner classes<br clear="none"> (anonymous or not), which are loaded by the same class loader as the component class loader, but not transformed as components.</p></div></div><h2 id="ComponentClasses-Sub-Folders/Sub-Packages">Sub-Folders / Sub-Packages</h2><p>Classes do not have to go directly inside the package (pages, components, mixins, etc.). It is valid to create a sub-package to store some of the classes. The sub-package name becomes part of the page name or component type. Thus you might define a page component <code>com.example.myapp.pages.admin.CreateUser</code> and the logical page name (which often shows up inside URLs) will be <st
 rong>admin/CreateUser</strong>.</p><p>Tapestry performs some simple optimizations of the logical page name (or component type, or mixin type). It checks to see if the package name is either a prefix or a suffix of the unqualified class name (case insensitively, of course) and removes the prefix or suffix if so. The net result is that a class name such as <code>com.example.myapp.pages.user.EditUser</code> will have a page name of <code>user/Edit</code> (<em>not</em> <code>user/EditUser</code>). The goal here is to provide shorter, more natural URLs.</p><h2 id="ComponentClasses-IndexPages">Index Pages</h2><p>One special simplification are Index pages: if the logical page name is Index after removing the package name from the unqualified class name, it will map to the root of that folder. A class such as <code>com.example.myapp.pages.user.IndexUser</code> or <code>com.example.myapp.pages.user.UserIndex</code> will have a page name of <code>user/</code>.</p><p>In previous versions of Ta
 pestry there was also the concept of a start page configured with the <code><a shape="rect" href="configuration.html">tapestry.start-page-name</a></code> configuration symbol (defaults to "start"). If a page with a name as configured with that symbol exists at the root level, this page is used as the root URL. This has precedence over an existing Index page. If for example you have a page class <code>com.example.myapp.pages.Start</code> it will map to <code>/</code>.</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>Use of start-pages is discouraged and support for it will eventually be removed. Use an Index page instead.</p></div></div><h2 id="ComponentClasses-Pagesvs.Components">Pages vs. Components</h2><p>The distinction between pages and component is very, very small. The only real difference is the pa
 ckage name: <em>root</em>.<strong>pages</strong>.<em>PageName</em> for pages, and <em>root</em>.<strong>components</strong>.<em>ComponentType</em> for components. Conceptually, page components are simply the <em>root component</em> of a page's component tree.</p><p><em>For Tapestry 4 users: there was a much greater distinction in Tapestry 4 between pages and components, which showed up as separate interfaces and a hierarchy of abstract implementations to extend your classes from.</em></p><h2 id="ComponentClasses-ClassTransformation">Class Transformation</h2><p>Tapestry uses your class as a starting point. It <em>transforms</em> your class at runtime. This is necessary for a number of reasons, including to address how Tapestry shares pages between requests.</p><p>For the most part, these transformations are both sensible and invisible. In a few limited cases, they are marginally <a shape="rect" class="external-link" href="http://www.joelonsoftware.com/printerFriendly/articles/LeakyAb
 stractions.html" >leaky</a> &#8211; for instance, the scope restrictions on instance variables described below &#8211; but we feel that the programming model in general will support very high levels of developer productivity.</p><p>Because transformation doesn't occur until <em>runtime</em>, the build stage of your application is not affected by the fact that you are creating a Tapestry application. Further, your classes are absolutely simple POJOs during unit testing.</p><h2 id="ComponentClasses-LiveClassReloading">Live Class Reloading</h2><p>Main Article: <a shape="rect" href="class-reloading.html">Class Reloading</a></p><p>Component classes are monitored for changes by the framework. <a shape="rect" href="class-reloading.html">Classes are reloaded when changed</a>. This allows you to build your application with a speed approaching that of a scripting environment, without sacrificing any of the power of the Java platform.</p><p>And it's fast! You won't even notice that this magic 
 class reloading has occurred.</p><p>The net result: super productivity &#8212; change your class, see the change instantly. This is designed to be a blend of the best of scripting environments (such as Python or Ruby) with all the speed and power of Java backing it up.</p><p>However, class reloading <em>only</em> applies to component classes and, starting in 5.2, Tapestry IOC-based service implementations (with some restrictions). Other classes, such as service interfaces, entity/model classes, and other data objects, are loaded by the normal class loader and not subject to live class reloading.</p><h2 id="ComponentClasses-InstanceVariables">Instance Variables</h2><p>Tapestry components may have instance variables (unlike Tapestry 4, where you had to use <em>abstract properties</em>).</p><p>Since release 5.3.2, instance variables may be protected, or package private (that is, no access modifier). Under specific circumstances they may even be public (public fields must either be fina
 l, or have the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Retain.html">Retain</a>&#160;annotation).</p><p><span style="line-height: 1.4285715;">Be aware that you will need to provide getter and setter methods to access your classes' instance variables. Tapestry </span><em style="line-height: 1.4285715;">does not</em><span style="line-height: 1.4285715;"> do this automatically unless you provide the @</span><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Property.html" style="line-height: 1.4285715;">Property</a><span style="line-height: 1.4285715;"> annotation on the field.</span></p><h2 id="ComponentClasses-TransientInstanceVariables">Transient Instance Variables</h2><p>Unless an instance variable is decorated with an annotation, it will be a <em>transient</em> instance variable. This means that its value resets to its default value a
 t the end of reach request (when the <a shape="rect" href="page-life-cycle.html">page is detached from the request</a>).</p><div class="confluence-information-macro confluence-information-macro-note"><p class="title">About initialization</p><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Never initialize an instance field to a <em>mutable</em> object at the point of declaration. If this is done, the instance created from that initializer becomes the default value for that field and is reused inside the component on every request. This could cause state to inadvertently be shared between different sessions in an application.</p></div></div>
 
 <div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Deprecated since 5.2</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
 </div></div>
 <div style="border-right: 20px solid #ffcccc;border-left: 20px solid #ffcccc;">
 <p>For Tapestry 5.1 and earlier, in the rare event that you have a variable that can keep its value between requests and you would like to defeat that reset logic, then you can add a @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Retain.html">Retain</a> annotation to the field. You should take care that no client-specific data is stored into such a field, since on a later request the same page <em>instance</em> may be used for a different user. Likewise, on a later request for the <em>same</em> client, a <em>different</em> page instance may be used.</p>
 </div><p>Use <a shape="rect" href="persistent-page-data.html">persistent fields</a> to hold client-specific information from one request to the next.</p><p>Further, final fields are (in fact) final, and will not be reset between requests.</p><h2 id="ComponentClasses-Constructors">Constructors</h2><p>Tapestry will instantiate your class using the default, no arguments constructor. Other constructors will be ignored.</p><h2 id="ComponentClasses-Injection">Injection</h2><p>Main Article: <a shape="rect" href="injection.html">Injection</a></p><p>Injection of dependencies occurs at the field level, via additional annotations. At runtime, fields that contain injections become read-only.</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[@Inject // inject a resource
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Inject // inject a resource
 private ComponentResources componentResources;
 
 @Inject // inject a block
 private Block foo;
 
 @Inject // inject an asset
-@Path(&quot;context:images/top_banner.png&quot;)
+@Path("context:images/top_banner.png")
 private Asset banner;
 
 @Inject // inject a service
 private AjaxResponseRenderer ajaxResponseRenderer;
-]]></script>
+</pre>
 </div></div><h2 id="ComponentClasses-Parameters">Parameters</h2><p>Main Article: <a shape="rect" href="component-parameters.html">Component Parameters</a></p><p>Component parameters are private fields of your component class annotated with @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Parameter.html">Parameter</a>. Component parameters represent a two-way binding of a field of your component and a property or resource of its containing component or page.</p><h2 id="ComponentClasses-PersistentFields">Persistent Fields</h2><p>Main Article: <a shape="rect" href="persistent-page-data.html">Persistent Page Data</a></p><p>Most fields in component classes are automatically cleared at the end of each request. However, fields may be annotated so that they retain their value across requests, using the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotation
 s/Persist.html">Persist</a> annotation.</p><h2 id="ComponentClasses-Embedded_ComponentsEmbeddedComponents"><span class="confluence-anchor-link" id="ComponentClasses-Embedded_Components"></span>Embedded Components</h2><p>Components often contain other components. Components inside another component's template are called <em>embedded components</em>. The containing component's <a shape="rect" href="component-templates.html">template</a> will contain special elements, in the Tapestry namespace, identifying where the the embedded components go.</p><p>You can define the type of component inside template, or you can create an instance variable for the component and use the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Component.html">Component</a> annotation to define the component type and parameters.</p><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[package org.example.app.pages;
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package org.example.app.pages;
 
 import org.apache.tapestry5.annotations.Component;
 import org.apache.tapestry5.annotations.Property;
@@ -114,13 +124,13 @@ import org.example.app.components.Count;
 public class Countdown
 {
     @Component(parameters =
-    { &quot;start=5&quot;, &quot;end=1&quot;, &quot;value=countValue&quot; })
+    { "start=5", "end=1", "value=countValue" })
     private Count count;
 
     @Property
     private int countValue;
 }
-]]></script>
+</pre>
 </div></div><p>The above defines a component whose embedded id is "count" (this id is derived from the name of the field and an element with that id must be present in the corresponding template, otherwise an error is displayed (see below)). The type of the component is org.example.app.components.Count. The start and end parameters of the Count component are bound to literal values, and the value parameter of the Count component is bound to the countValue property of the Countdown component.</p><p>Technically, the start and end parameters should be bound to properties, just the the value parameter. However, certain literal values, such as the numeric literals in the example, are accepted by the <code>prop:</code> binding prefix even though they are not actually properties (this is largely as a convenience to the application developer). We could also use the <code>literal:</code> prefix, <code>"start=literal:5"</code>, which accomplishes largely the same thing.</p><p>You may specify 
 additional parameters inside the component template, but parameters in the component class take precedence.</p><p><strong>TODO: May want a more complex check; what if user uses prop: in the template and there's a conflict?</strong></p><p>You may override the default component id (as derived from the field name) using the id() attribute of the Component annotation.</p><p>If you define a component in the component class, and there is no corresponding element in the template, Tapestry will log an error. In the example above that would be the case if the template for the Countdown page didn't contain an element with <code>&lt;t:count t:id="count"&gt;</code>.</p></div>
 </div>
 

Modified: websites/production/tapestry/content/component-events-faq.html
==============================================================================
--- websites/production/tapestry/content/component-events-faq.html (original)
+++ websites/production/tapestry/content/component-events-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,15 +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="link-components-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="link-components-faq.html">Link Components 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="javascript-faq.html">JavaScript FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="re
 ct" href="javascript-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 id="ConfluenceContent"> 
 
 <h2 id="ComponentEventsFAQ-ComponentEvents">Component Events </h2>
 
@@ -96,16 +98,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 <h3 id="ComponentEventsFAQ-IspecifiedazoneinmyActionLink/EventLink,sowhydoesn'tmyeventfireviaajax(request.isXHR()isfalse)?">I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?</h3>
 
 <p>Check your browser's JavaScript console for errors. It's likely that a JavaScript error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.</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="link-components-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="link-components-faq.html">Link Components 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="javascript-faq.html">JavaScript FAQ</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="re
 ct" href="javascript-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>
 </div>
 
 <div class="clearer"></div>

Modified: websites/production/tapestry/content/component-events.html
==============================================================================
--- websites/production/tapestry/content/component-events.html (original)
+++ websites/production/tapestry/content/component-events.html Sun Jul 19 21:21:27 2015
@@ -27,6 +27,16 @@
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
 
+    <link href='/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  <script src='/resources/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -59,20 +69,20 @@
 <div id="content">
 <div id="ConfluenceContent"><h1 id="ComponentEvents-ComponentEvents">Component Events</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><strong>Component events</strong> are Tapestry's way of conveying a user's interactions with the web page, such as clicking links and submitting forms, to designated methods in your page and component classes. When a component event occurs, Tapestry calls the event handler method you've provided, if any, in the containing component's class.</p><p>Let's review a simple example. Here's a portion of the template for a page (let's call it "Chooser") that lets the user choose a number between 1 and 10:</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;p&gt; Choose a number from 1 to 10:
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;p&gt; Choose a number from 1 to 10:
 
-    &lt;t:count end=&quot;10&quot; value=&quot;index&quot;&gt;
-        &lt;a t:id=&quot;select&quot; t:type=&quot;actionlink&quot; context=&quot;index&quot;&gt;${index}&lt;/t:comp&gt;
+    &lt;t:count end="10" value="index"&gt;
+        &lt;a t:id="select" t:type="actionlink" context="index"&gt;${index}&lt;/t:comp&gt;
     &lt;/t:count&gt;
 &lt;/p&gt;
-]]></script>
+</pre>
 </div></div><p>Notice that Chooser.tml contains an ActionLink component. When rendered on the page, the ActionLink component creates a component event request URL, with the event type set to "action". In this case the URL might look like <code><a shape="rect" class="external-link" href="http://localhost:8080/chooser.select/3" >http://localhost:8080/chooser.select/3</a></code></p><p>This URL identifies the page that contains the component ("chooser"), the type of event (unless it is "action", the default and most common event type), the id of the component within the page ("select"), plus the additional context value ("3"). <em>Additional context values, if any, are appended to the path.</em></p><p>There's no direct mapping from URL to a piece of code. Instead, when the user clicks on the link, the ActionLink component emits events. And then Tapestry ensures that the correct bit of code (your event handler method, see below) gets invoked for those events.</p><p>This demonstrates a cr
 itical difference between Tapestry and a more traditional, action oriented framework. The URL doesn't say what happens when the link is clicked, it identifies <em>which component is responsible</em> when the link is clicked.</p><p>Often, a navigation request (originating with the user) will spawn a number of flow-of-control requests. For example, an action event will trigger a form component, which will then emit notification events to announce when the form submission is about to be processed, and whether it was successful or not, and those event could be further handled by the page component.</p><h1 id="ComponentEvents-EventHandlerMethods">Event Handler Methods</h1><p>When a component event occurs, Tapestry invokes any event handler methods that you have identified for that event. You can identify your event handler methods via a naming convention (see Method Naming Convention below), or via the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidoc
 s/org/apache/tapestry5/annotations/OnEvent.html">OnEvent</a> annotation.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  @OnEvent(component = &quot;select&quot;)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  @OnEvent(component = "select")
   void valueChosen(int value)
   {
     this.value = value;
   }
-]]></script>
+</pre>
 </div></div><p>Tapestry does two things here:</p><ul><li>Because of the annotation, it identifies method valueChosen() as the method to invoke.</li><li>When the link is clicked, it converts the context value from a string to an integer and passes it into the method.</li></ul>
 
 <div class="confluence-information-macro confluence-information-macro-information"><p class="title">Added in 5.3</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
@@ -80,20 +90,20 @@
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
 <p>Starting in release 5.3, Tapestry will validate that the component, if any, identified for the event handler method actually exists in the containing component's template. This helps with typos in annotations (or in the naming conventions identified below).</p>
 </div><p>In the above example, the valueChosen() method will be invoked when the default event, "action", occurs in the <code>select</code> component (and has at least one context value).</p><p>For some components, more than one type of event can occur, in which case you will want to be more specific:</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[  @OnEvent(value = &quot;action&quot;, component = &quot;select&quot;)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  @OnEvent(value = "action", component = "select")
   void valueChosen(int value)
   {
     this.value = value;
   }
-]]></script>
+</pre>
 </div></div><p>The <code>value</code> attribute of the OnEvent annotation is the name of the event to match. The default event type is "action"; the ActionLink and Form components each use this event type. Alternatively, we could have used an EventLink component, in which case the name of the event is determined by the element's ID, rather than being "action".</p><p>If you omit the <code>component</code> part of the OnEvent annotation, then you'll receive notifications from <em>all</em> contained components, possibly including nested components (due to event bubbling).</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>You should usually specify exactly which component(s) you wish to receive events from. Using @OnEvent on a method and not specifying a specific component id means that the method will be invoke
 d for events from <em>any</em> component.</p></div></div><p>Event handler methods are normally given package-private visibility, to support testing, although technically they may have any visibility (even private).</p><p>A single event handler method may receive notifications from many different components.</p><p>As elsewhere, the comparison of event type and component id is case-insensitive.</p><h2 id="ComponentEvents-MethodNamingConvention">Method Naming Convention</h2><p>As an alternative to the use of annotations, you may name your event handling methods following a certain convention, and Tapestry will find and invoke your methods just as if they were annotated.</p><p>This style of event handler methods start with the prefix "on", followed by the name of the action. You may then continue by adding "From" and a capitalized component id (remember that Tapestry is case insensitive about event names and component ids). So, for example, a method named onActionFromSelect(), if it exi
 sts, is invoked whenever an <code>Action</code> event is emitted by the <code>select</code> component.</p><p>The previous example may be rewritten as:</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 onActionFromSelect(int value)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  void onActionFromSelect(int value)
   {
     this.value = value;
   }
-]]></script>
+</pre>
 </div></div><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 from Howard: I've found that I prefer the naming convention approach, and reserve the annotation just for situations that don't otherwise fit.</p></div></div><h2 id="ComponentEvents-MethodReturnValues">Method Return Values</h2><p>Main Article: <a shape="rect" href="page-navigation.html">Page Navigation</a></p><p>For page navigation events (originating in components such as EventLink, ActionLink and Form), the value returned from an event handler method determines how Tapestry will render a response.</p><ul><li><strong>Null</strong>: For no value, or null, the current page (the page containing the component) will render the response.</li><li><strong>Page</strong>: For the name of a page, or a page class or page instance, a render request URL
  will be constructed and sent to the client as a redirect to that page.</li><li><strong>URL</strong>: For a java.net.URL, a redirect will be sent to the client. (In Tapestry 5.3.x and earlier, this only works for non-Ajax requests.)</li><li><strong>Zone body</strong>: In the case of an Ajax request to update a zone, the component event handler will return the new zone body, typically via an injected component or block.</li><li><strong>HttpError</strong>: For an <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/HttpError.html">HttpError</a>, an error response is sent to the client.</li><li><strong>Link</strong>: For a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/Link.html">Link</a>, a redirect is sent to the client.</li><li><strong>Stream</strong>: For a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapes
 try5/StreamResponse.html">StreamResponse</a>, a stream of data is sent to the client</li></ul><p>See <a shape="rect" href="page-navigation.html">Page Navigation</a> for more details.</p><h2 id="ComponentEvents-MultipleMethodMatches">Multiple Method Matches</h2><p>In some cases, there may be multiple event handler methods matching a single event. In that case, Tapestry invokes them in the following order:</p><ul><li>Base class methods before sub-class methods.</li><li>Matching methods within a class in alphabetical order.</li><li>For a single method name with multiple overrides, by number of parameters, descending.</li></ul><p>Of course, ordinarily would you <em>not</em> want to create more than one method to handle an event.</p><p>When a sub-class overrides an event handler method of a base class, the event handler method is only invoked once, along with any other base class methods. The subclass can change the <em>implementation</em> of the base class method via an override, but ca
 n't change the <em>timing</em> of when that method is invoked. See <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/TAP5-51">issue TAP5-51</a>.</p><h1 id="ComponentEvents-EventContext">Event Context</h1><p>The context values (the context parameter to the EventLink or ActionLink component) can be any object. However, only a simple conversion to string occurs. (This is in contrast to Tapestry 4, which had an elaborate type mechanism with the odd name "DataSqueezer".)</p><p>Again, whatever your value is (string, number, date), it is converted into a plain string. This results in a more readable URL.</p><p>If you have multiple context values (by binding a list or array of objects to the <em>context</em> parameter of the EventLink or ActionLink), then each one, in order, will be added to the URL.</p><p>When an event handler method is invoked, the strings are converted back into values, or even objects. A <a shape="rect" class="external-link" href="http://
 tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValueEncoder.html">ValueEncoder</a> is used to convert between client-side strings and server-side objects. The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ValueEncoderSource.html">ValueEncoderSource</a> service provides the necessary value encoders.</p><p>As shown in the example above, most of the parameters passed to the event handler method are derived from the values provided in the event context. Each successive method parameter matches against a value provided in the event context (the context parameter of the ActionLink component; though many components have a similar context parameter).</p><p>In some cases, it is desirable to have direct access to the context (for example, to adapt to cases where there are a variable number of context values). The context values may be passed to an event handler method as parameter of the following types:</p><ul><
 li><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/EventContext.html">EventContext</a></li><li>Object[]</li><li>List&lt;Object&gt;</li></ul><p>The latter two should be avoided, they may be removed in a future release. In all of these cases, the context parameter acts as a freebie; it doesn't match against a context value as it represents <em>all</em> context values.</p><h2 id="ComponentEvents-AccessingRequestQueryParameters">Accessing Request Query Parameters</h2><p>A parameter may be annotated with the @RequestParameter annotation; this allows a query parameter to be extracted from the request, converted to the correct type, and passed to the method. Again, this doesn't count against the event context values.</p><h2 id="ComponentEvents-MethodMatching">Method Matching</h2><p>An event handler method will only be invoked <em>if the context contains at least as many values as the method has parameters</em>. Methods with too ma
 ny parameters will be silently skipped.</p><p>Tapestry will silently skip over a method if there are insufficient values in the context to satisfy the number of parameters requested.</p><p>EventContext parameters, and parameters annotated with @RequestParameter, do not count against this limit.</p><h2 id="ComponentEvents-MethodOrdering">Method Ordering</h2><p>When multiple methods match within the same class, Tapestry will invoke them in ascending alphabetical order. When there are multiple overrides of the same method name, Tapestry invokes them in descending order by number of parameters. In general, these situations don't happen ... in most cases, only a single method is required to handle a specific event form a specific component.</p><p>An event handler method may return the value <code>true</code> to indicate that the event has been handled; this immediately stops the search for additional methods in the same class (or in base classes) or in containing components.</p><h1 id="C
 omponentEvents-EventBubbling">Event Bubbling</h1><p>The event will bubble up the hierarchy, until it is aborted. The event is aborted when an event handler method returns a non-null value.</p><p>Returning a boolean value from an event handler method is special. Returning true will abort the event with no result; use this when the event is fully handled without a return value and no further event handlers (in the same component, or in containing components) should be invoked.</p><p>Returning false is the same as returning null; event processing will continue to look for more event handlers, in the same component or its parent.</p><p>When an event bubbles up from a component to its container, the origin of the event is changed to be the component. For example, a Form component inside a BeanEditForm component may fire a success event. The page containing the BeanEditForm may listen for that event, but it will be from the BeanEditForm component (which makes sense, because the id of the 
 Form inside the BeanEditForm is part of the BeanEditForm's implementation, not its public interface).</p><h1 id="ComponentEvents-EventMethodExceptions">Event Method Exceptions</h1><p>Event methods are allowed to throw any exception (not just runtime exceptions). If an event method does throw an exception, Tapestry will catch the thrown exception and ultimately display the exception report page.</p><p>In other words, there's no need to do this:</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 onActionFromRunQuery()
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  void onActionFromRunQuery()
   {
     try
     {
@@ -104,23 +114,23 @@
       throw new RuntimeException(ex);
     }
   }
-]]></script>
+</pre>
 </div></div><p>Instead, you may simply say:</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 onActionFromRunQuery() throws JDBCException
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  void onActionFromRunQuery() throws JDBCException
   {
     dao.executeQuery();
   }
-]]></script>
+</pre>
 </div></div><p>Your event handler method may even declare that it "throws Exception" if that is more convenient.</p><h1 id="ComponentEvents-InterceptingEventExceptions">Intercepting Event Exceptions</h1><p>When an event handler method throws an exception (checked or runtime), Tapestry gives the component and its containing page a chance to handle the exception, before continuing on to report the exception.</p><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:0 1em">
 <p>    <strong>JumpStart Demo:</strong><br clear="none">
     <a shape="rect" class="external-link" href="http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/handlingabadcontext/1" >Handling A Bad Context</a></p></div><p>Tapestry emits a new event, of type "exception", passing the thrown exception as the context. In fact, the exception is wrapped inside a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/runtime/ComponentEventException.html">ComponentEventException</a>, from which you may extract the event type and context.</p><p>Thus:</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 onException(Throwable cause)
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">  Object onException(Throwable cause)
   {
     message = cause.getMessage();
 
     return this;
   }
-]]></script>
+</pre>
 </div></div><p>The return value of the exception event handler <em>replaces</em> the return value of original event handler method. For the typical case (an exception thrown by an "activate" or "action" event), this will be a <a shape="rect" href="page-navigation.html">navigational response</a> such as a page instance or page name.</p><p>This can be handy for handling cases where the data in the URL is incorrectly formatted.</p><p>In the above example, the navigational response is the page itself.</p><p>If there is no exception event handler, or the exception event handler returns null (or is void), then the exception will be passed to the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html">RequestExceptionHandler</a> service, which (in the default configuration) will render the exception page.</p></div>
 </div>
 



Mime
View raw message