Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As alternative, you could override <code>refreshProperties</code> method from <code>ReloadableResourceBundleMessageSource</code> class like below example:</p> <pre><code>public class MultipleMessageSource extends ReloadableResourceBundleMessageSource { private static final String PROPERTIES_SUFFIX = ".properties"; private PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); @Override protected PropertiesHolder refreshProperties(String filename, PropertiesHolder propHolder) { Properties properties = new Properties(); long lastModified = -1; try { Resource[] resources = resolver.getResources(filename + PROPERTIES_SUFFIX); for (Resource resource : resources) { String sourcePath = resource.getURI().toString().replace(PROPERTIES_SUFFIX, ""); PropertiesHolder holder = super.refreshProperties(sourcePath, propHolder); properties.putAll(holder.getProperties()); if (lastModified &lt; resource.lastModified()) lastModified = resource.lastModified(); } } catch (IOException ignored) { } return new PropertiesHolder(properties, lastModified); } } </code></pre> <p>and use it with spring context configuration like <code>ReloadableResourceBundleMessageSource</code>:</p> <pre><code> &lt;bean id="messageSource" class="common.utils.MultipleMessageSource"&gt; &lt;property name="basenames"&gt; &lt;list&gt; &lt;value&gt;classpath:/messages/validation&lt;/value&gt; &lt;value&gt;classpath:/messages/messages&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;property name="fileEncodings" value="UTF-8"/&gt; &lt;property name="defaultEncoding" value="UTF-8"/&gt; &lt;/bean&gt; </code></pre> <p>I think this should do the trick.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload