db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lach, Thierry" <Thierry.L...@bbdodetroit.com>
Subject RE: Configure Torque for Struts
Date Wed, 06 Aug 2003 13:32:06 GMT
I have deployed Torque-based applications via EAR on Websphere 4.0 and
via WAR on Tomcat 4.0 and 4.1 - in both cases I am using a relatively
standard properties file to contain Torque properties.    Create a
servlet whose only purpose is to initialize torque - set a parameter
containing the context-relative path of the configuration file, use
getRequest().getRealPath("/") and append the context-relative path to
get the complete path, and make sure the servlet is load-on-startup.

-----Original Message-----
From: Robles, Rogelio [mailto:Rogelio.Robles@experian.com] 
Sent: Tuesday, August 05, 2003 7:18 PM
To: 'Apache Torque Users List'
Subject: RE: Configure Torque for Struts



> -----Original Message-----
> From: Keeney, Thomas [mailto:KeeneyT@SEC.GOV]
...
> 
> Hello All,
> 
> If you want to retrieve Torque.properties to pass into
> Torque.init(), just
> load it from the classpath.
> 
> i.e. put Torque.properties into WEB-INF/classes
> 
> then use the following code:
>       URL propsFile = 
> this.getClass().getClassLoader().getResource("Torque.properties");
> Torque.init(propsFile.getPath());
> 

If I want to do an .EAR (or .WAR only) deployment of a Torque based app
I need Torque to read its properties using an InputStream (with the help
of
getClassLoader().getResourceAsStream()) is that directly supported by
Torque? if is not directly what do you do for a deployment scenario like
that?

Rogelio



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message