I'm using a class to get a property file under the source folder. But it doesn't work! After checking, I found that the default path by using the File f = new File("/src/ss.properties"); is not the web application path but the glassfish config path! What can I do if I want to fetch the property file stored in the "classes" path? Usually the default path is the project path, you know.
I've used the ClassLoader.getResourceAsStream("sss") .But it returns null! I'm sure the file name is correct because I've tried it in another simple JAVA app.
Update: Hi~ I used this.getClass().getClassLoader().getResourceAsStream("sectionMapping.properties");
instead of ClassLoader.getSystemResource("sectionMapping.properties")
did the trick! I wonder why?