Fork me on GitHub

HST-2 Repository ResourceBundle MessageSource


If you want to take advantage of HST-2 Repository Dynamic ResourceBundle as MessageSource in your Spring Framework application, then you should configure the following MessageSource bean instead of the default ResourceBundleMessageSource.


  <!-- SNIP -->

  <!-- Set HstRepositoryResourceBundleMessageSource to be able to use HST-2 Repository Dynamic Resource Bundles. -->
  <bean id="messageSource" class="">
      You don't have to specify hard-coded 'basenames' property here,
      but you can still add some standard Java resource bundle basenames additionally.
      So, in this example, if a resource key is not found from the bundle(s) configured in
      HST-2 configuration (hst:sitemapitem, hst:mount, hst:virtualhost or hst:virtualhosts as ordered by precedence), then it may fall
      back to the specified Java standard resource bundle (e.g, 'classpath:org/hippoecm/hst/demo/spring/webmvc/').
    <property name="basenames">

  <!-- SNIP -->


See the Javadoc of HstRepositoryResourceBundleMessageSource for more detail.