Saturday, May 9, 2009

Spring PropertyPlaceholderConfigurer

Here is the code to use PropertyPlaceholderConfigurer with XMLBeanFactory

XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("test.xml"));
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.setLocation(new ClassPathResource("jdbc.properties"));
// now actually do the replacement
cfg.postProcessBeanFactory(factory);
MyBean bean = (MyBean)factory.getBean("myBean");
System.out.println(bean .getProperty());

5 comments:

Anonymous said...

Thanks

Anonymous said...

Validate Our Ward Prices at www.Pharmashack.com, The Basic [b][url=http://www.pharmashack.com]Online Chemist's boutique [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Branchlet Nonentity Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Steal in a Tickety-boo Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] On account of Your Nutriment ! We Huckster Barter specify identify [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !

Anonymous said...

I read this forum since 2 weeks and now i have decided to register to share with you my ideas. [url=http://inglourious-seo.com]:)[/url]

Anonymous said...

Hi Guys,Just registered here and looking to have a great time. I am looking for the best cash gifting program out there in the internet. Can you guide me?

Below are some sites that I found and I am not sure how much they are going to help me.
[url=http://www.squidoo.com/Residual-Cash-Forever-Cash-Gifting-System]cash gifting[/url]
[url=http://www.squidoo.com/Residual-Cash-Forever-Cash-Gifting-System]join cash gifting[/url]
[url=http://www.squidoo.com/Residual-Cash-Forever-Cash-Gifting-System]best cash gifting program[/url]

Anonymous said...

It isn't hard at all to start making money online in the hush-hush world of [URL=http://www.www.blackhatmoneymaker.com]blackhat seo techniques[/URL], Don’t feel silly if you haven’t heard of it before. Blackhat marketing uses alternative or not-so-known avenues to build an income online.