You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by bu...@apache.org on 2018/02/11 13:19:53 UTC
svn commit: r1025207 - in /websites/production/tapestry/content:
cache/main.pageCache component-classes.html configuration.html
Author: buildbot
Date: Sun Feb 11 13:19:53 2018
New Revision: 1025207
Log:
Production update by buildbot for tapestry
Modified:
websites/production/tapestry/content/cache/main.pageCache
websites/production/tapestry/content/component-classes.html
websites/production/tapestry/content/configuration.html
Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/tapestry/content/component-classes.html
==============================================================================
--- websites/production/tapestry/content/component-classes.html (original)
+++ websites/production/tapestry/content/component-classes.html Sun Feb 11 13:19:53 2018
@@ -176,8 +176,7 @@ public class HelloWorld
<div class="aui-message aui-message-warning">
Deprecated since 5.2 |
-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 @[Retain|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Retain.html] 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 _instance_ may be used for a different user. Likewise, on a later request for the _same_ client, a _different_ page instance may be used.
-
+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 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.
</div><p>Use <a href="component-classes.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 href="component-classes.html">Component Classes</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">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Inject // inject a resource
private ComponentResources componentResources;
Modified: websites/production/tapestry/content/configuration.html
==============================================================================
--- websites/production/tapestry/content/configuration.html (original)
+++ websites/production/tapestry/content/configuration.html Sun Feb 11 13:19:53 2018
@@ -147,11 +147,11 @@
<h1 id="Configuration-ConfiguringTapestry">Configuring Tapestry</h1><p>This page discusses all the ways in which Tapestry can be configured. Tapestry applications are configured almost entirely using Java, with very little XML at all.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1518351765728 {padding: 0px;}
-div.rbtoc1518351765728 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1518351765728 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1518355172930 {padding: 0px;}
+div.rbtoc1518355172930 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1518355172930 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1518351765728">
+/*]]>*/</style></p><div class="toc-macro rbtoc1518355172930">
<ul class="toc-indentation"><li><a href="#Configuration-XMLconfiguration(web.xml)">XML configuration (web.xml)</a></li><li><a href="#Configuration-YourApplication'sModuleClass">Your Application's Module Class</a></li><li><a href="#Configuration-ConfigurationSymbolNames">Configuration Symbol Names</a></li><li><a href="#Configuration-SettingComponentParameterDefaults">Setting Component Parameter Defaults</a></li><li><a href="#Configuration-ConfiguringIgnoredPaths">Configuring Ignored Paths</a></li><li><a href="#Configuration-ConfiguringContentTypeMapping">Configuring Content Type Mapping</a></li><li><a href="#Configuration-SettingExecutionModes">Setting Execution Modes</a></li></ul>
</div><h2 id="Configuration-XMLconfiguration(web.xml)">XML configuration (web.xml)</h2><p>Tapestry runs on top of the standard Java Servlet API. To the servlet container, such as Tomcat, Tapestry appears as a <em>servlet filter</em>. This gives Tapestry great flexibility in matching URLs without requiring lots of XML configuration.</p><p>Although most configuration is done with Java, a small but necessary amount of configuration occurs inside the servlet deployment descriptor, WEB-INF/web.xml. Most of the configuration is boilerplate, nearly the same for all applications.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>web.xml (partial)</b></div><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><!DOCTYPE web-app
@@ -302,7 +302,7 @@ Added in 5.4 |
<div class="aui-message aui-message-warning">
Deprecated since 5.2 |
-Starting in Tapestry 5.2, the optimization to generate relative URIs has been removed, and all URIs are always absolute. _Removed in 5.3._
+Starting in Tapestry 5.2, the optimization to generate relative URIs has been removed, and all URIs are always absolute. _Removed in 5.3._
</div><p><em>For Tapestry 5.0 and 5.1 only</em>: when false (the default), Tapestry will attempt to optimize URIs that it generates, using relative URIs when such URIs are shorter than absolute URIs. When true, all URIs will be absolute URIs (including the context path, and the complete path for the request).</p><h3 id="Configuration-tapestry.gzip-compression-enabled(SymbolConstants.)">tapestry.gzip-compression-enabled (SymbolConstants.)</h3><p>Override to "false" to disable GZIP compression of dynamic Tapestry pages and static assets.</p><h3 id="Configuration-tapestry.hostname(SymbolConstants.GZIP_COMPRESSION_ENABLED)">tapestry.hostname (SymbolConstants.GZIP_COMPRESSION_ENABLED)</h3>
@@ -352,7 +352,6 @@ Added in 5.4 |
<div class="aui-message aui-message-info">
Added in 5.4 |
When set to true, the DateField component will be lenient about date calculations, for example allowing a January 32 date as input and automatically converting it to February 1. When false (the default), only valid dates may be entered.
-
</div><h3 id="Configuration-tapestry.min-gzip-size(SymbolConstants.MIN_GZIP_SIZE)">tapestry.min-gzip-size (SymbolConstants.MIN_GZIP_SIZE)</h3><p>The minimum stream size necessary for Tapestry to use GZIP compression on the response stream. See <a href="response-compression.html">Response Compression</a> for more details.</p><h3 id="Configuration-tapestry.omit-generator-meta(SymbolConstants.OMIT_GENERATOR_META)">tapestry.omit-generator-meta (SymbolConstants.OMIT_GENERATOR_META)</h3><p>If "true", then the <meta> tag that Tapestry normally writes into the <head>, identifying the Tapestry version, will be omitted. Use this when you do not wish to advertise your application's use of Tapestry.</p><h3 id="Configuration-tapestry.page-pool.active-window">tapestry.page-pool.active-window</h3>
@@ -382,7 +381,7 @@ Starting in 5.2, this is only used if ta
<div class="aui-message aui-message-warning">
Deprecated since 5.2 |
-Starting in 5.2, this is only used if tapestry.page-pool-enabled is "true". _Removed in 5.3_
+Starting in 5.2, this is only used if tapestry.page-pool-enabled is "true". <em>Removed in 5.3</em>
</div><p>The time interval that Tapestry will wait for a page instance to become available before deciding whether to create an entirely new page instance.</p><p>The default is "10 ms" (10 milliseconds; see <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/util/TimeInterval.html">Time Interval Formats</a>).</p><h3 id="Configuration-tapestry.persistence-strategy(SymbolConstants.PERSISTENCE_STRATEGY)">tapestry.persistence-strategy (SymbolConstants.PERSISTENCE_STRATEGY)</h3><p>Identifies the default <a class="external-link" href="http://tapestry.apache.org/persistent-page-data.html#PersistentPageData-PersistenceStrategies">persistence strategy</a> for all pages that do not provide an override. The default is "session" (PersistenceConstants.SESSION).</p><h3 id="Configuration-tapestry.production-mode(SymbolConstants.PRODUCTION_MODE)">tapestry.production-mode (SymbolConstants.PRODUCTION_MODE)</h3><p>A flag (true or false) indicating wheth
er the application is running in production or in development. The default is true, which means that runtime exceptions are not reported with full detail (only the root exception message is displayed, not the entire stack of exceptions, properties and other information shown in development mode).</p><h3 id="Configuration-tapestry.restrictive-environment(SymbolConstants.RESTRICTIVE_ENVIRONMENT)">tapestry.restrictive-environment (SymbolConstants.RESTRICTIVE_ENVIRONMENT)</h3><p>
@@ -414,7 +413,7 @@ Added in 5.4 |
<div class="aui-message aui-message-warning">
Deprecated since 5.2 |
-_Removed in 5.3._
+<em>Removed in 5.3</em>
</div><p>Normally, Tapestry responds to action requests (such as form submissions) by sending a client-side redirect to the rendering page. This has a lot of benefits in terms of improving browser navigation, making sure URLs are bookmarkable, and so forth. However, it has a cost: more data stored persistently in the session, and a double-request for each user action (one action request, one render request).</p><p>Setting this symbol to "true" changes the Tapestry behavior to make it more like Tapestry 4: a markup response is sent directly for the action request, with no redirect in the middle. This option should be used with care, and only in cases where you are certain that the benefits outweigh the disadvantages.</p><h3 id="Configuration-tapestry.thread-pool.core-pool-size(IOCSymbols.THREAD_POOL_CORE_SIZE)">tapestry.thread-pool.core-pool-size (IOCSymbols.THREAD_POOL_CORE_SIZE)</h3><p>Nominal size of the thread pool Tapestry uses to execute tasks in parallel. Under sufficient load
, the thread pool may grow larger than this core size. Defaults to 3.</p><h3 id="Configuration-tapestry.thread-pool.max-pool-size(IOCSymbols.THREAD_POOL_MAX_SIZE)">tapestry.thread-pool.max-pool-size (IOCSymbols.THREAD_POOL_MAX_SIZE)</h3><p>Maximum size of the thread pool Tapestry uses to execute tasks in parallel. Defaults to 10.</p><h3 id="Configuration-tapestry.thread-pool.queue-size(IOCSymbols.THREAD_POOL_QUEUE_SIZE)">tapestry.thread-pool.queue-size (IOCSymbols.THREAD_POOL_QUEUE_SIZE)</h3>
@@ -428,12 +427,7 @@ Previously, the queue size was unbounded
<div class="aui-message aui-message-info">
Added in 5.3 |
- Some components, notably Grid, Pallete and Zone, have default parameter values specified in terms of symbols. This means you can use these symbols to modify the defaults for all instances of such components in your application. For example, you can set the default rows per page for all Grid instances by adding this to the {{contributeApplicationDefaults}} method in your application's module class (typically AppModule.java):
-
-{code}
-configuration.add(ComponentParameterConstants.GRID_ROWS_PER_PAGE, "15");
-{code}
-
+Some components, notably Grid, Pallete and Zone, have default parameter values specified in terms of symbols. This means you can use these symbols to modify the defaults for all instances of such components in your application. For example, you can set the default rows per page for all Grid instances by adding this to the <code>contributeApplicationDefaults</code> method in your application's module class (typically AppModule.java): <code>configuration.add(ComponentParameterConstants.GRID_ROWS_PER_PAGE, "15");</code>
</div><p>See the complete list of such constants at <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ComponentParameterConstants.html">ComponentParameterConstants</a>.</p><h2 id="Configuration-ConfiguringIgnoredPaths">Configuring Ignored Paths</h2><p>You may sometimes need to use Tapestry in concert with other servlets. This can cause problems, since Tapestry (being a servlet filter) may see URLs intended for another servlet and attempt to process them.</p><p>The Servlet API does not provide Tapestry with any clues about what other servlets are available in the web application. Instead, you must configure Tapestry to ignore paths intended for other servlets.</p><p>The IgnoredPathsFilter service is the method for this kind of configuration. Its configuration is an unordered collection of regular expression patterns. A request whose path matches any of these patterns is <strong>not</strong> processed by Tapestry.</p><p>For example, say yo
u are using <a class="external-link" href="http://getahead.org/dwr/" rel="nofollow">Direct Web Remoting</a>. You'll likely have the servlet path /dwr mapped to the Direct Web Remoting servlet.</p><p>You contribution would look like:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> public static void contributeIgnoredPathsFilter(Configuration<String> configuration)
{
@@ -498,7 +492,6 @@ configuration.add(ComponentParameterCons
<div class="aui-message aui-message-info">
Added in 5.3 |
Support for application folders was added in release 5.3.
-
</div><p>Setting this up is in two parts:</p><ul><li>Modifying the configuration of the <code><url-pattern></code> for the Tapestry filter to match the specified folder.</li><li>Identifying the folder name using a Tapestry symbol value contribution.</li></ul><p>So, if you wanted to run the Tapestry application inside folder <code>t5app</code>, you would modify your <code>web.xml</code> indicate the use of the folder:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"> <filter-mapping>
<filter-name>app</filter-name>