Since you are using Spring why not loading properties files "the Spring way"? Use the util
roperties tag in Spring xml config file to register a bean of type java.util.Properties with your configuration loaded:
Code:
<util:properties id="mailerProperties" location="classpath:mailer.properties"/>
Then you can access properties using Spring EL, both in xml and using the @Configuration and @Value javaconfig annotations on your beans (or you can dependency inject the mailerProperties bean itself into components that need to use it).
Or, if you prefer old xml configuration, use PropertyPlaceHolderConfigurer:
Code:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:mailer.properties</value>
</property>
</bean>
to obtain the same results.