File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


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: 1025
    
    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: 1025
    
    5

I believe so Sebastian.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
ok cool ... thank's for your help.
 
GeeCON Prague 2014
 
subject: Bean Autowiring, PropertyPlaceholderConfigurer