Announcement Announcement Module
Collapse
No announcement yet.
@Value annotation mixed with property-placeholder Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @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
    Did you ever resolve this? I have exact same issue.

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

    Comment


    • #3
      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

      Comment


      • #4
        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)

        Comment


        • #5
          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

          Comment


          • #6
            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, 07:01 AM.

            Comment


            • #7
              Not Answered

              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.

              Comment

              Working...
              X