I am trying to read a properties file ("my.properties"), which I put right
under /WEB-INF when I created an eclipse project.
I told Spring where the file is like this:
<bean id="propertyPlaceholderConfigurer" class="xx..
<property name="locations">
<list>
<value>/WEB-INF/my.properties</value>
</list>
</property>
</bean>
I created a war file, and deployed under /webapps.
Inside some class, which is an ordinary java class (not a servlet), I wanted to
read that "my.properties" file like this:
InputStream inputStream =
this.getClass().getClassLoader().getResourceAsStream("WEB-INF/my.properties");
When I "System.out" inputStream, it is null.
cas.log has this error:
org.springframework.beans.factory.BeanInitializationException: Could not load
properties; nested exception is java.io.FileNotFoundException: Could not open
ServletContext resource [/my.properties]
I spent a day googling, but could not make it work-- that's why I am here.
What's happening? Can someone give me some pointers?
Thanks!
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user