Results 1 to 2 of 2

Thread: property-variable and default value

  1. #1
    Join Date
    May 2006
    Posts
    10

    Question property-variable and default value

    Hi,
    I have a property that I want to define using a variable, something like this:

    <bean id="someId" class="package.SomeClass" >
    <property name="someProperty" value="${user.myProperty}" />
    </bean>

    What I would like to do is that if user.Property does exist, then it is used but if it does not, then some default value is used instead. I cannot just set some default value in the class as it is a class coming from some outside package, not my own.

    Is there a way to do this?

    Thanks,
    Llaurick

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    You can use the PropertyOverrideConfigurer as described here: http://static.springframework.org/sp...rideconfigurer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •