• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Application properties

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am very newby in oas.
I have an application in spring and must be deployed in several regional goverment offices. Each of theese offices has a different configuration (ip adresses, database instance, users and so on). We have placed this parameters in .properties files. We want to deploy the application as a .war file plus several .properties files. The main objective is that reponsible at each location can modify the configuration files by himself, and not to loose the configuration when new versions of the software are released.
My question is in which folder of the oas must I place those .properties files in order the application is able to read them at start up time.

And now some code:

in the applicationContext.xml we have something like this:
-------------------------------------------------------------------------
<beans>
<import resource="classpath:springMapping/applicationContext-db.xml"/>
...
<import resource="classpath*:ServiceDeskCore/applicationContext-*.xml"/>
</beans>
-------------------------------------------------------------------------
So, the * in the last line means that if there are any applicationContext-*.xml in a folder called ServiceDeskCore, its configuration replaces the configuration loaded with the first line.

And in the applicationContext-*.xml we have something like this:
-------------------------------------------------------------------------
<bean id="DbPropertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:sdk_db.properties</value>
<value>file:etc/springframework/sdk_db.properties</value>
<value>classpath*:ServiceDeskCore/sdk_db.properties</value>
</list>
</property>
</bean>
-------------------------------------------------------------------------

This code works fine in JBoss, as we put the external configuration in a folder call $JBOSS_HOME/server/default/conf/ServiceDeskCore

Thank you for your time, I'm looking forward your reponses.
Best regards.
P.D.: I expect that you can understand what is my problem despite my poor English.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic