File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes config.ini file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "config.ini file" Watch "config.ini file" New topic

config.ini file

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2373

I want to load the reference of config.ini file from a component (class) that will be used in a servlet. What are the options to direct the location of the file for me. Say I want to put my config.ini file in /docweb/WEB-INF directory. Here docweb is my application's name. I'll read a RandomAccessFile to read/write and forward values to a JSP file.
AFAI understand, I may use a servlet <init-param> to direct the locationas /docweb/WEB-INF/config.ini or use a ResourceBundle like InputStream in = config.getServletContext().getResourceAsStream("WEB-INF/config.ini");
Is these two approaches Ok, or am I missing any syntax here? Should not Tomcat get them automatically? And any alternate approach?

Ashik Uzzaman
Senior Software Engineer, TubeMogul, Emeryville, CA, USA.
I agree. Here's the link:
subject: config.ini file
It's not a secret anymore!