Results 1 to 7 of 7

Thread: @Value annotation mixed with property-placeholder

  1. #1
    Join Date
    Nov 2008
    Posts
    5

    Question @Value annotation mixed with property-placeholder

    Hi all,

    I have the following problem.

    we use contextroperty-placeholder to load two properties.
    <contextroperty-placeholder location="classpathroject-default.properties,${projectConfPath}project-specific.properties"/>

    The project-default.properties is part of the war file.
    The project-specific.properties files is retrieved using as a prefix the system variable projectConfPath.
    This enables to use the same war file and deploy it on various servers, overriding only the necessary properties (in project-specific.properties).

    Now using Spring 3.0.1 I would like the same when using the @Value annotation. Unfortunately I only seem to find examples for loading a single properties file(using utilroperties).
    Is it possible to use @Value annotation and load 2 properties where the latter overrules the first one?

    Kind regards,

    Nicolas

  2. #2
    Join Date
    Nov 2008
    Posts
    27

    Default Did you ever resolve this? I have exact same issue.

    Did you ever resolve this? I have exact same issue.

  3. #3
    Join Date
    Nov 2009
    Posts
    7

    Default

    Guys,

    I am struggling to get this working as well.

    Please do let me know if you find the solution.

    You can post your answer/solution to my question here: http://forum.springsource.org/showth...454#post297454

    Thanks
    scorpi77

  4. #4
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    23

    Default

    How do you access the properties ?

    I don't have any problem using :
    Code:
    @Value("${settings.some.property}")
    (I'm using multiple locations in the PropertyPlaceholderConfigurer)

  5. #5

    Default Answered

    This question was answered a year before you asked it -- please search the forums before posting.

    http://forum.springsource.org/showthread.php?t=69602

  6. #6
    Join Date
    Nov 2009
    Posts
    7

    Default

    Hi opyate,

    I hope you read the thread in detail before posting your reply.

    I am trying to load multiple property files based on the enviroment. The thread link you posted in your reply doesnt provide the solution I am after.

    See my original post here.

    http://forum.springsource.org/showth...454#post297454

    thanks.
    Last edited by scorpi77; May 3rd, 2011 at 06:01 AM.

  7. #7
    Join Date
    Jan 2012
    Posts
    2

    Default Not Answered

    Quote Originally Posted by opyate View Post
    This question was answered a year before you asked it -- please search the forums before posting.

    http://forum.springsource.org/showthread.php?t=69602
    Poor form opyate... if you would have read the OP's post you would see that they are trying to use it with the Placeholder Configurer.

Tags for this Thread

Posting Permissions

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