I have to load a properties file from a bean.This bean is called from the jsp page. The properties file is in the same folder as the jsp page.But how do I get the correct path in the bean to load the property file. If I call the System.getProperty("user.dir"), it gives me the path to the folder before the jsp page.(Not the one where the jsp and the property file is).My jsp lies in the following path - c:\\prgram files\allaire\JRun\servers\default\time and the path returned by System.get... is c:\\program files\JRun\servers\default . I don't want to add the folder Time to the path in the code b'coz it may change in different environments. (This is in extension with my earlier mail.Though the complete problem is detailed out here.)
If you put the properties file on the class apth then it's actually easier than that: Drop it on the class path, use ClassLoader.findResource to get a handle on the file (via a URL) then open an InputStream and read it.