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 config file locaiton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "config file locaiton" Watch "config file locaiton" New topic
Author

config file locaiton

sakthivel shanmugam
Greenhorn

Joined: Nov 10, 2002
Posts: 4
Dear All,
I want to set some values in my config file in the domino server and fetch it from my servlet file....

using the code as:
**************
Properties parameters = new Properties();
String filewithroot = getServletConfig().getInitParameter("configFile");
try
{
File file_temp = new File(filewithroot);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file_temp),buffersize);
parameters.load(bis);
if(parameters != null)
{
path = parameters.getProperty("ereview.servlet.path");
path_stylesheet = parameters.getProperty("finishedmeetings.stylesheet.path");
}
}
catch(Exception exception)
{}

which is that config file?? becoz i dont found any config file over here...or should i go for the creation of a new config file.....if so, what should be the name and extension of that config file....also, where(in which directory) it should be placed in the server...also, should i do some setting changes in the domino server.
pl. post a reply,
with rgds,
Sakthive S.
Mohamed Yousuff
Ranch Hand

Joined: Jun 23, 2001
Posts: 73
If the domino server is J2EE complaint then you can specify the config values in the deployment descriptor file. If the server is not J2EE complaint then you need to consult the domino server documentation, since it may vary from server to server.

Originally posted by sakthivel shanmugam:
Dear All,
I want to set some values in my config file in the domino server and fetch it from my servlet file....

using the code as:
**************
Properties parameters = new Properties();
String filewithroot = getServletConfig().getInitParameter("configFile");
try
{
File file_temp = new File(filewithroot);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file_temp),buffersize);
parameters.load(bis);
if(parameters != null)
{
path = parameters.getProperty("ereview.servlet.path");
path_stylesheet = parameters.getProperty("finishedmeetings.stylesheet.path");
}
}
catch(Exception exception)
{}

which is that config file?? becoz i dont found any config file over here...or should i go for the creation of a new config file.....if so, what should be the name and extension of that config file....also, where(in which directory) it should be placed in the server...also, should i do some setting changes in the domino server.
pl. post a reply,
with rgds,
Sakthive S.
Matthew X. Brown
Ranch Hand

Joined: Nov 08, 2000
Posts: 165
Well- the servlet init parameters should be described in the web.xml file- so find that file first. Then that file has the init param for your servlet where the config file resides(most likely its a .properties file). If you don't have the init param, you'll need to add one to the web.xml file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: config file locaiton