Tapestry has been expanding quickly over the last couple of months; the
framework already supports an even easier way of doing what you want,
mostly.
Most (but not quite all) configuration values that used to be specified as
JVM system properties can now be specified as:
- <property> in the app spec
- <init-param> (for <servlet>) in web.xml
- <init-param> (for servlet context) in web.xml
- JVM system property
There's even a hook where you can insert your own IPropertySource instance
into the list, to (say), get properties from a database or JMX or something.
Disable caching and enable reset service are the exceptions though; I still
require those to be JVM system properties. I typically run my app servers
using Ant, so adding new JVM system properties is not an issue.
----- Original Message -----
From: "Malcolm Edgar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 8:11 PM
Subject: [Tapestry-developer] Configuring Tapestry properties
> Often application servers have very convoluted batch files/scripts for
> launching, and hacking these to add Tapestry system properties is last
thing
> you want to do.
>
> Here is a neat way (well I think so) of configuring these properties using
> an application specification extension bean.
>
> Add the extension element to you application specification and add the
> TapestryPropertiesSetter class.
>
> The extentions element in specification, initializes the
> TapestryPropertiesSetter bean and sets the configuration properties when
the
> application loaded.
>
> Configuring Assets to an external directory can make a big difference to
> performance.
>
> regards Malcolm
>
> -------------------------------
>
> <extension name="sys-props" class="com.mycorp.TapestryPropertiesSetter"
> immediate="yes">
> <configure property-name="disableCaching"
> type="boolean">true</configure>
> <configure property-name="assetDir"
>
type="String">C:/java/jakarta-tomcat-4.1.18/webapps/tutorial/asset</configur
e>
> <configure property-name="assetURL" type="String">asset</configure>
> </extension>
>
> -------------------------------
>
> package com.mycorp;
>
> public class TapestryPropertiesSetter
> {
> public void enableResetService(boolean enableReset)
> {
> System.setProperty("net.sf.tapestry.enable-reset-service", "" +
> enableReset);
> }
>
> public void setDisableCaching(boolean disableCaching)
> {
> System.setProperty("net.sf.tapestry.disable-caching", "" +
> disableCaching);
> }
>
> public void setAssetDir(String assetDir)
> {
> System.setProperty("net.sf.tapestry.asset.dir", assetDir);
> }
>
> public void setAssetURL(String assetURL)
> {
> System.setProperty("net.sf.tapestry.asset.URL", assetURL);
> }
> }
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: FREE SSL Guide from Thawte
> are you planning your Web Server Security? Click here to get a FREE
> Thawte SSL guide and find the answers to all your SSL security issues.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer