Announcement Announcement Module
Collapse

JavaConfig forum decommissioned in favor of Core Container

As described at

http://static.springsource.org/sprin...fig/README.TXT

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:

http://static.springsource.org/sprin...tml#beans-java

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at

http://forum.springsource.org/forumdisplay.php?f=26
See more
See less
What Happend to @PropertiesValueSource and @ExternalValue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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" - http://static.springframework.org/sp.../changelog.txt

    Comment


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

      Comment


      • #4
        Chris,

        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

        Comment


        • #5
          Nick,

          Take a look at this issue: http://jira.springframework.org/browse/SPR-5682. 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

          Comment


          • #6
            Hi,
            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.

            Comment

            Working...
            X