Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with Spring i18n

Status
Not open for further replies.

SwapSawe

Programmer
Apr 24, 2001
148
0
0
US
Hello All !!!

I have got a problem with spring, could not understand where should i redirect this to..

We are using Spring framework's ResourceBundleMessageSource, to use i18n feature, now my requirement is to have the errorMessages out of my jar, and may not be necessarily on classpath, so how should I go for setting basename using absolute path?

Any help would be appreciated, even if u cud think of an alternative way.

Regards,
SwapSawe.


Cheer Up, The worst is yet to Come.
 
Sounds like you may need to provide your own MessageSource implementation. Something like subclassing the ResourceBundleMessageSource class and overriding the doGetBundle(String basename, Locale locale) method might do the trick. Your overridden method would search for, and unpack, the resources as your requirements have them, and create ResourceBundle objects from them to return.

Just like to stress I haven't tried this myself.

Tim
 
Thanks Tim, I wud look into that direction till now, i was just looking for some short cut. On a second thought, I am still open to short-cuts ;)

Cheer Up, The worst is yet to Come.
 
Shortcut ... use a .properties language resource on the classpath with the provided ResourceBundleMessageSource.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top