Possible Duplicate:
How to load a .properties file into a jsp
I am trying to use my property file in JSP but it wont work properly and throws an error
Error: myproperties.properties (The system cannot find the file specified)
Here I am trying to access my property file:
<%
try
{
FileInputStream fis = new FileInputStream("myproperties.properties");
Properties p = new Properties();
p.load(fis);
String LogFileName = p.getProperty("NameOfLogFile");
out.println(LogFileName);
}
catch (Exception e)
{// Catch exception if any
out.println(e.getMessage());
}
I have tried by many ways to access property file. How do I fix this?
create test.properties file in your package
create jsp file: