Announcement Announcement Module
Collapse
No announcement yet.
Default Property Values and PropertyPlaceholderConfigurer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default Property Values and PropertyPlaceholderConfigurer

    when the PropertyPlaceholderConfigurer is used, the default properties (defined in the bean code) get overridden by the values that are defined in the properties file. If the properties file did not exist, the bean will not be crezted. I would like to make the properties file optional. Also looked at the PropertyOverrideConfigurer. Still can't figure out how to make the bean work with default values when the properties file is absent. Any clue is greatly appreciated.

    Thanks,

    Ashwath Akirekadu

  • #2
    The answer

    Got it working now. I had to use a different syntax in the properties file.

    While using PropertyOverrideConfigurer you don't use the ${...} format in application context XML. You can define the actual value for the property or simply have no entry for that property if you intend to use the default values defined in the bean code itself.

    The syntax for the properties file is:

    Code:
    beanName.propertyName=value

    ------
    Ashwath Akirekadu

    Comment

    Working...
    X