Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    See the javadoc for PropertySource, see Resolving ${...} placeholders in <bean> and @Value annotations Commented Jul 11, 2013 at 19:01
  • Also, see the answer here. A PropertySourcesPlaceHolderConfigurer is a BeanFactoryPostProcessor. Commented Jul 11, 2013 at 19:04
  • 3
    It may work in some situations if Spring generates some beans after your propertiesResolver() is called, but it will fail otherwise. To make sure it works, you need to make it static. Commented Jul 11, 2013 at 19:06
  • When using XML, this will work This happens automatically when using <context:property-placeholder> in XML docs.spring.io/spring-framework/docs/3.2.x/javadoc-api/org/… Commented Mar 9, 2022 at 8:34