Couldn't you just use a physical properties file? Am I missing some
reason that you can't just drop the properties file in your classpath and
use the good old fashioned:

InputStream in =
this.class.getClassLoader().getResourceAsStream("application.properties");
                if (in == null) {
                        Log.warn("We couldn't find your
application.properties file. Using all defaults.");
                }
        Properties foo = new Properties();
        try {
                        foo.load(in);
                } catch (IOException e) {
                        Log.error("Couldn't parse your
application.properties file");
                        Log.error("Proceeding with all default values, but
you should really fix the properties");
                        
                }

        --- Pat

> -----Original Message-----
> From: sean gao [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 30, 2005 1:18 AM
> To: [email protected]
> Subject: global configuration and usage of org.apache.tapestry.property-
> source
> 
> can anybody help me on these two questions please?
> Thanks
> Sean
> 
> > <Question 1>
> > I would like load  configurable global properties  in my application
> > These are name/value pairs such as
> >   tempfolder.path=/home/users/temp
> >   default.color=white
> > stored in .properties files or in a database.
> >
> > Ideally I would like to be able to set something like this in the
> > application specification file
> >    <property name="org.apache.tapestry.global-config">
> >        config.properties{,config2.properties,config3.properties}
> >    </property>
> > But this seems to be impossible without patching tapestry3
> >
> > Guess I could extend  BaseEngine or define a custom version of Global .
> > Just wondering which is the common way of achieving this in tapestry?
> >
> > <Question 2>
> > It is mentioned in the user guide
> >
> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configurat
> ion.extensions.html
> >
> > "  org.apache.tapestry.property-source (IPropertySource
> > <../api/org/apache/tapestry/engine/IPropertySource.html>)
> >     This extension is fit into the configuration property search path,
> > after the servlet context, but before JVM system           properties.
> > A typical use would be to access some set of configuration properties
> > stored in a database.
> > "
> > Can anyone give an example?
> >
> > Thanks
> > Sean
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to