"Put the properties file uder WEB-INF/classes. use the getClass().getResourceAsStream("/propertyFile.props") method to locate the properties file. Create an instance of Properties and use its load(InputStream) method"
Let me know where to use this getClass method, as a java class or use in jsp declaration. I dont want use java class for this. I want use include directive or jsp declaration?
Can you give snippet of the code for declaration?
SP
<!%
private static Properties props = new Properties();
public void jspInit() {
props.load(this.getClass().getResourceAsStream("/propertyFile.props") );
}
%>
http://www.fawcette.com/javapro/2002_02/online/online_eprods/servlets_bkurniawan2_5/default_pf.aspx
You should know how to catch exceptions in java.
try{
props.load(this.getClass().getResourceAsStream("/topic.properties") );
} catch(IOException e){
e.printStackTrace();
}