Announcement Announcement Module
Collapse
No announcement yet.
import 'application settings' from a separate file?.. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • import 'application settings' from a separate file?..

    Hi, All,

    Half way through a pilot Spring project. So far looks good. The only problem I start to see now is the growing size of the config file(s).

    I wonder if there is any mechanism in Spring I'm not aware of which would allow you to reference 'text' properties defined in a separate file (eg, in 'ant' way, see property 'zzz':

    Application settings file:
    Code:
    <property='zzz' value='xxx'/>
    Spring config file:
    Code:
    <beans>
      <bean>....
         <property>
            <name>xxxxx</name>
            <value>$&#123;zzz&#125;</value>
    ......
    The idea is to separate 'internal' application configuration (beans wiring, etc) from 'external' one (consider 'interal' being done by developers - which classes to be used and how, external - by support stuff, more like 'deployment' settings)

    Any way to do that without creating 'global' config Java bean? Probably some parameters to Spring 'import' tag?..

  • #2
    I think you are looking for PropertyPlaceholderConfigurer :

    http://www.springframework.org/docs/...onfigurer.html

    http://www.springframework.org/docs/...lderconfigurer

    Maarten

    Comment

    Working...
    X