We use an external castor.properties file and never mess with the jar.
The only catch is that the directory containing the properties file needs to be known
to the classloader.
In the case of using Castor with our JBoss-based web app, that just means putting the
castor.properties file in the same location as the castor.jar file for loading by
JBoss, i.e. in the directory JBOSS_HOME\server\yourservername\lib.
For a stand-alone Java app, that just means that your CLASSPATH should include both
the castor.jar file path AND the path of the directory containing the
castor.properties file, i.e.
CLASSPATH=%CLASSPATH%;yourcastorpath\castor-xml.jar;yourcastorpath
Leo Joncas
-----Original Message-----
From: Nick Stuart [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 8:37 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Easier way to configure castor...
I was just wondering if there would be an easier way to setup Castor so
that people could configure it from outside the jar. I find that it can
be a little annoying (all though not all that difficult) to open up the
jar file, edit the properties file, and then repackage it or update it.
If there is a way to do this just yell at me. :) But my idea was to
possibly setup up an external properties file that would get read in
first. And any properties in it would override what ever is in the
internal one. (Kind of like how Ant does it currently). Currently I'm
not sure how castor reads the property file and uses it, i.e.. Does it
read it in all at once, or only when it needs to find out a setting when
running. Guess I'll have to take a look at this, if it's the first case
I would imagine this change wouldn't be all that difficult, if it's the
second I'm not sure what would be involved.
-Nick
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev