I've gotten as far as this:
private Properties logoUrls = new Properties();
logoUrls.load(new FileInputStream("channelLogos.properties"));
where channelLogos.properties is in the same directory as my JSP. I get a FileNotFound exception. Where does my app actually think I mean by "channelLogos.properties", if not the same directory as the JSP? How can I determine the correct path to load the properties file?
This will do the job:
<%@page import="java.io.InputStream" %>
<%@page import="java.util.Properties" %>
<%
InputStream stream = application.getResourceAsStream("/some.properties");
Properties props = new Properties();
props.load(stream);
%>
Anyway I really think you should have the properties file in the classpath and use a servlet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With