• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

how to pass an env variable into Spring xml

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




The problem is --- I only want one application.xml, but need to use it for various environment like dev/test/prod.  So ${db.host.url} has to be different per env.  How to handle this issue ?
 
Saloon Keeper
Posts: 22111
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For webapps, one doesn't use environment variables. But then again, for webapps, you'd configure a Connection Pool in the webserver and inject that into the application.xml of the webapp.

For stand-alone apps, environment variables make sense. In such cases, you can configure like this:


 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic