File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Using Resource Bundle in XML Config file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Using Resource Bundle in XML Config file" Watch "Using Resource Bundle in XML Config file" New topic

Using Resource Bundle in XML Config file

M A Mujeeb

Joined: Aug 05, 2010
Posts: 11
I have followed this thread

and was successful in accessing the resource bundle in the xml file. However the problem i face is accessing a language specific resource bundle.

I am only able to access the latest specified property ie;;

When I set locale to FR, I should be able to access; How do i do this? How do i make the xml file access locale specific resource file dynamically.

Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
I don't believe PropertyPlaceholderConfigurer was meant to be used in an I18N scenario. In this case, you probably want to consider something from the resource bundle interfaces like ResourceBundleMessageSource or ReloadableResourceBundleMessageSource. In that case, you may need to find another way to set the property on your beans as it won't work in the context of the XML config file processing.
M A Mujeeb

Joined: Aug 05, 2010
Posts: 11

Thanks for your input. I feel you are right.
Raghu Devatha
Ranch Hand

Joined: Feb 10, 2009
Posts: 39
Why does one want to inject multiple i18n resource bundles. Should that not be part of implementation.
Unrelated but, I was just curious.

As I understand, PropertyPlaceholderConfigurer is for injecting the application properties. I guess should be used for loading i18n messages.

jQuery in Action, 2nd edition
subject: Using Resource Bundle in XML Config file
Similar Threads
Warnings with message resource
Accessing property file , path given as environmental variable
Spring security and jsf Integration
language propertis to xml properties
getting property value in jsp page from