I have a properties file in JAR file.
In my web application, I want to access this properties file from the jsp within web application.
I try doing it with the following code, but results in FileNotFoundException
Properties properties = new Properties();
properties.load(new FileInputStream("myfile.properties"));
How can i access the file from JAR which is in my classpath within scriptlets in jsp?
Thanks in advance.
Not this way.
You can try to get the Input Stream by using ‘getResourceAsStream’ functionality.
Read about this Here
Hope this helps