There are two ways. The first is the way that I prefer, and another
is one that my co-worker prefers.
1. When you access your resource, use
ClassLoader.getResourceAsStream() and then use the fully qualified class
name (i.e. org.apache.tomcat.Tomcat), but you will need to replace the .
with / (regardless of platform). Now your properties files can be in the
same place as your class files.
2. Use ServletContext.getRealPath() + "/WEB-INF/classes/" +
qualified class name and use a FileInputStream. I'm not sure if the slash
before /WEB-INF is necessary.
Randy
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: Doug McNamara
Doug McNamara -
Sorry if this creates duplicates I sent this mail when I subscribed but
I am not sure if that's what need to do.
I am using Tomcat 3.2.1. I have a number of classes that use property
files.
Each class file expects its .prp file to be in the same directory as the
class file
itself. When I run startup.bat in the tomcat bin directory the user.dir
system
property is changed to that bin dir so all my property files have to be
moved
to that directory. I am using win 98 and NT. is there a way around this.
If any one can help that would be great!
regards Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]