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!
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!