Tapestry occasionally must obtain a value for a configuration property. These configuration properties are items that are frequently optional, and don't fit into any particular specification. Many are related to the runtime environment, such as which class to instantiate as the Visit object.
Tapestry is very flexible about where values for such properties may be obtained. In general, the search path for configuration properties is:
As a <property>
of the <application>
(in the application specification,
if the application uses one).
As an <init-parameter>
for the servlet, in the web application deployment descriptor.
As an <init-parameter>
for the servlet context, also in the web application deployment descriptor.
As a JVM system property.
Hard-coded "factory" defaults (for some properties).
It is expected that some configurations are not defined at any level; those will return null.
Applications are free to leverage this lookup mechanism as well. IEngine
defines
a propertySource
property (of type IPropertySource
)
that can be used to perform such lookups.
Applications may also want to change or augment
the default search path; this is accomplished by overriding
AbstractEngine
method createPropertySource()
. For example,
some configuration data could be drawn from a database.
The following are all the configuration values currently used in Tapestry:
Configuration Values
org.apache.tapestry.template-extension
Overrides the default extension used to locate templates for pages or components. The default extension is "html", this configuration property allows overrides where appropriate. For example, an application that produces WML may want to override this to "wml".
This configuration property does not follow the normal search path rules. The
<property>
must be provided in the <page-specification>
or <component-specification>
.
If no value is found there, the immediate containing <application>
or
<library-specification>
is checked. If still not found, the default is used.
org.apache.tapestry.asset.dir
, org.apache.tapestry.asset.URL
These two values are used to handle private assets. Private assets are assets that are stored on the classpath, and not normally visible to client web browsers.
By specifying these two configuration values, Tapestry can export private assets
to a directory that is visible to the client web browser. The URL
value should map to the directory specified by the dir
value.
org.apache.tapestry.visit-class
The fully qualified class name to instantiate as the Visit object.
If not specified, an instance of HashMap
will be created.
org.apache.tapestry.default-page-class
By default, any page that omits the
class
attribute (in its <page-specification>
)
will be instantiated as BasePage
. If this is not desired,
the default may be overridden by specifying a fully
qualified class name.
org.apache.tapestry.engine-class
The fully qualified class name to instantiate as the application engine.
This configuration value is only used when the
application specification does not exist, or fails to
specify a class. By default, BaseEngine
is used if this configuration
value is also left unspecified.
org.apache.tapestry.enhance.disable-abstract-method-validation
Used to work around a bug in IBM's JDK 1.3.1. This JDK reports all methods
of an abstract class as abstract, even if they are concrete. This causes spurious errors
about unimplemented abstract methods. Specifying true
for this property
disables checks for unimplemented abstract methods.
org.apache.tapestry.global-class
The fully qualified class name to instantiate as the engine global
property. The Global object is much like Visit object,
except that it is shared by all instances
of the application engine rather than being private to any particular session.
If not specified, a synchronized instance of HashMap
is used.
org.apache.tapestry.default-script-language
The name of a BSF-supported language, used when a
<listener-binding>
element does not specify
a language. If not overridden, the default is "jython".
org.apache.tapestry.enable-reset-service
If not specified as "true", then the reset
service
will be non-functional. The reset service is used to force
the running Tapestry application to discard all cached data (including
templates, specifications, pooled objects and more). This must
be explicitly enabled, and should only be used in development (in production,
it is too easily exploited as a denial of service attack).
Unlike most other configuration values, this must be specified as a JVM system property.
org.apache.tapestry.disable-caching
If specified (as "true"), then the framework will discard all cached data (specifications, templates, pooled objects, etc.) at the end of each request cycle.
This slows down request handling by a noticable amount, but is very useful in development; it means that changes to templates and specifications are immediately visible to the application. It also helps identify any errors in managing persistent page state.
This should never be enabled in production; the performance hit is too large. Unlike most other configuration values, this must be specified as a JVM system property.
org.apache.tapestry.output-encoding
Defines the character set used by the application to encode its HTTP responses. This is also the character set that the application assumes that the browser uses when submitting data unless it is not specified differently in the HTTP request.
The default for this configuration property is UTF-8. Normally there is no need to modify this value since UTF-8 allows almost all characters to be correctly encoded and displayed.
org.apache.tapestry.template-encoding
Defines the character set used by the application templates. The default value is ISO-8859-1.
Please see the Character Sets section for more information.