开发者

Load a ResourceBundle over HTTP?

开发者 https://www.devze.com 2023-02-18 17:19 出处:网络
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

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开发者_如何学Python 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消