This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Spring and the fly likes Bean Autowiring, PropertyPlaceholderConfigurer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Bean Autowiring, PropertyPlaceholderConfigurer" Watch "Bean Autowiring, PropertyPlaceholderConfigurer" New topic
Author

Bean Autowiring, PropertyPlaceholderConfigurer

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Hey guys,

I am currently switching to the spring auto wiring mechanism and face the following problem.



Using the plain xml configuration, I would wire the config value in using the PropertyPlaceholderConfigurer and then simply pass the value using <constructor-arg value="${prop.name}" />

How would I do this in the auto wiring world??


Thank's for your help


JDBCSupport - An easy to use, light-weight JDBC framework -
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 973
    
    5

As of Spring 3, you can use @Value:


Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Awesome.

The PropertyPlaceholderConfigurer get's set up in the spring context the usual way right ?
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 973
    
    5

I believe so Sebastian.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
ok cool ... thank's for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bean Autowiring, PropertyPlaceholderConfigurer
 
Similar Threads
Spring beans with the same property name but different references
Data Table: Can't update ResultSet from JSP page
External sql with Spring
read properties in my java application defined in spring bean "PropertyPlaceholderConfigurer"
Better approach if i have multiple datasources JNDIObjectFactoryBean or JVM Variables