Archive for August, 2009

Domain properties in Glassfish

Thursday, August 20th, 2009

You can make properties files available to you WAR and EAR applications by putting the file in the folder glassfish/domains/${glassfish.domain.name}/lib/classes

You can use these in your spring configuration by prefixing the resource name with classpath:. For example:

<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <beans:property name="location" value="classpath:some.properties"/>
</beans:bean>

Configuration Properties in Spring

Tuesday, August 11th, 2009

Make configuration properties from a properties file available in a Spring context

<bean id="propertyPlaceholderConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
   <property name="locations">
      <list>
         <value>application.properties</value>
      </list>
   </property>
</bean>