Announcement Announcement Module

JavaConfig forum decommissioned in favor of Core Container

As described at

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at
See more
See less
What Happend to @PropertiesValueSource and @ExternalValue Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • What Happend to @PropertiesValueSource and @ExternalValue

    What happend to @PropertiesValueSource and @ExternalValue when JavaConfig was merged into Spring Core?

  • #2
    Unfortunately, the release notes were far from helpful:

    "* introduced annotated @Bean factory methods and JavaConfig-style @Configuration classes" -


    • #3
      @ExternalValue, @PropertiesValueSource (and the other *ValueSource annotations) have all been supplanted by Spring 3.0's @Value annotation and use of Spring EL. The reference documentation is just shaping up around this now. Search for those terms, and please post any questions you have afterward.


      • #4

        I do not see an annotated equivalent of PropertiesValueSource, <property-placeholder />, or PropertyPlaceholderConfigurer. I was expecting to be able to reference the location of my properties file without having to use XML.

        - Nick


        • #5

          Take a look at this issue: Please vote for it, and consider adding an issue requesting pure-java support for property-placeholder like functionality.

          It's user feedback just like this that we're looking for as we decide what should make it into core. Thanks.

          - C


          • #6
            I'm using <context: property-placeholder> to load some settings from a properties file, and I'm also using Spring annotations to configure my application with minimal XML.

            I can't figure out a way to access properties in the Spring annotations. I want to do something like @Value("#{myProperty}"), just like I can normally do in the XML when using the property-placeholder.

            This thread and the mentioned issue lead me to believe this is currently not possible. Is that true? Is there any way to simulate this with SpringEL?

            Otherwise, what's the best way to deal with this right now? In my case I am using Spring MVC annotations, and it looks like if I try to redefine my controller bean in XML I get duplicate controllers. So should I define a separate XML-based Configuration bean and inject that into my controllers?

            BTW I am using Spring 3.0 M3.