Alex,
    You can use the Class.getResource(<file>) method to lookup a resource file.  This will use the classpath to search for the file. 
 
Example:
        String database = "mydatabase";
        String databaseFile =  "/com/opendemand/jdo/database.xml";
        JDO jdo = new JDO();
        jdo.setConfiguration(  this.getClass().getResource( databaseFile ).toString() );
        jdo.setDatabaseName(database);
Steve
----- Original Message -----
Sent: Tuesday, December 03, 2002 8:19 PM
Subject: [castor-dev] mapping file has to be in curr working directory or else absolute path??

Hi,

 

I'm using Castor in a webapp, where I can't specify the current working directory.  The Castor configuration file has a reference to the mapping file

            <mapping href="" />

 

Q:  does this href path have to be an absolute path?? 

1)       I can't control current working directory since the webapp is running in Tomcat. 

2)       When I used a relative path, Castor treated it as relative to current working directory, which in Tomcat was C:\tomcat\bin\

 

An absolute path in this config file would make deployment very difficult.

 

Cheers

 

Alex

Reply via email to