The moose likes Spring and the fly likes Bean Autowiring, PropertyPlaceholderConfigurer Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Bean Autowiring, PropertyPlaceholderConfigurer" Watch "Bean Autowiring, PropertyPlaceholderConfigurer" New topic
Author

Bean Autowiring, PropertyPlaceholderConfigurer

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1173
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
Ranch Hand

Joined: Nov 09, 2011
Posts: 344
As of Spring 3, you can use @Value:


Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1173
Awesome.

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

Joined: Nov 09, 2011
Posts: 344
I believe so Sebastian.
Sebastian Janisch
Ranch Hand

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

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture