Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load a ResourceBundle over HTTP?

I have a requirement to load text labels from our CMS. The content is exposed in standard properties file format. The CMS operates as a sort of RESTful web service provider as opposed to pushing files, so I would need to pull properties files on demand. I was naively hoping that if I created a ReloadableResourceBundleMessageSource and set the basename to the URL of the file minus the locale parameter, that this would work like magic, but evidently it doesn't. Can anyone suggest an approach to this? Is there an out-of-the-box solution in Spring or is there some class that I would need to extend?

like image 326
jiggy Avatar asked Nov 14 '22 01:11

jiggy


1 Answers

So, skaffman's comment was correct. My web service was just expecting the locale as a GET param (locale=en_US), but was getting a file suffix (ie, locale=_en_US.properties). So, it was as simple matter of stripping the extra stuff from the param and it actually works fine.

like image 174
jiggy Avatar answered Nov 16 '22 16:11

jiggy