You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marco Westermann <Ma...@gmx.de> on 2011/10/03 16:01:28 UTC

using properties in flowscript

Hi,

I try to use a property from a file in flowscript. At the moment I have 
the following code which actually works:

function __getProperty(propertyName) {
     var props = new java.util.Properties();
     props.load(new java.io.FileInputStream("D:\\qsf.properties"));
     var prop = props.getProperty(propertyName);
     return prop;


the problem is the D:\\qsf.properties as this is a fixed dir and I'd 
like to have it relative to the install-location of coccon.
How could I find out the install location of cocoon?

Important is, that the configuration file should be outside the cocoon 
application war.

btw: I use cocoon 2.1

thanks Marco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: using properties in flowscript

Posted by Andy Stevens <in...@googlemail.com>.
As an alternative to worrying about where the container happens to store the
application when you install it, so you can put the property file relative
to it, why not use a jvm system property to supply the property file's
location?
Or a resource-env-ref lookup?

Andy.
-- 
http://original.justgiving.com/andystevens-bikeathon2011
Raising money for Leukaemia research
 On 3 Oct 2011 15:02, "Marco Westermann" <Ma...@gmx.de> wrote: