Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to read properties file from a JSP

Status
Not open for further replies.

pavelcoan

Programmer
Sep 17, 2002
11
MX
Does anyone have an idea how to read a properties file from a JSP?

I got one servlet example and works fine

the code:

public void init(ServletConfig config)
throws ServletException
{
super.init(config);
try
{
configFile = config.getInitParameter("configFile");
vars = new Properties();
vars.load(new FileInputStream(configFile));
}
catch(IOException ioe)
{
System.out.println(ioe.getMessage());
}
}

private Properties vars;
private String configFile;

//getting properties

String ip = vars.getProperty("ip");
String db_passwd = vars.getProperty("db_passwd");
String IsRedirec = vars.getProperty("IsRedirec");
String db_user = vars.getProperty("db_user");
String db_url = vars.getProperty("db_url");

but need to load properties from a JSP

thanx for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top