Before going on with this post, I apologize if this isn't the best place to put this question, but after reading the
thread .properties vs JNDI, I see my question is related.
I'm trying to load a .properties file from within an .ear file. In other words, I have a properties file inside my .ear file, and I'm trying to find the right way of loading the file. Currently my solution which works is utilizing the getResourceAsStream() method which returns an InputStream object which will be used in Properties.load(InputStream), therefore loading the properties. This works flawlessly either when the ear is exploded or running locally or when it's deployed.
However, when I read the above mentioned thread, I see using java.io goes against the
EJB specs. First of all, is this true? Secondly, if it is true, is my current technique in violation of this?
I'm finding some conflict with this because I also have seen threads regarding the use of
Struts where the struts-specific files make use of getResourceAsStream. This is partly where I'm finding some confusion.
I will stress I am using this properties file for READING ONLY. I am NOT writing to it in any way shape or form. Thanks a bunch.
PS -- If any Moderator feels that this is not appropriate for this forum, please move it. Thank you