Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


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

config.ini file

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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?
:roll:


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: config.ini file
 
Similar Threads
Servlet config in servlets
relative directory path
Where to save a file separately for different users in same web server?
ServletContext, its attribute to be shared for all over the Servlet?
Relative path with JAR files