File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getInitParameter not working... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getInitParameter not working..." Watch "getInitParameter not working..." New topic
Author

getInitParameter not working...

sean cee
Ranch Hand

Joined: Oct 24, 2000
Posts: 115
Hi all,
I have a problem with this method.
I am running my servlet in install-dir/webpages/WEB-INF/servlets/
and have servlets.properties in install-dir/webpages/WEB-INF/ but
my Servlet doesn't read initialization values. I dont' know why.
I thought I set up all the CLASSPATH and PATH right..
Can you think of anything?
Thanks


Sean <br />SCJP2, SCJP2p1.4, SCWCD
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
You need to find out what directory is the actual working directory for your servlet. It's not always obvious. Put a debug printout in your servlet to tell you this info. You obtain it using System.getProperty("user.dir"). Then ensure your property file is place in the directory it shows.
Hope this helps


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getInitParameter not working...
 
Similar Threads
accessing servlets
referencing fileset by id
accessing servlets
problem with first servlet
Configuration file..