title: get all keys from spring ReloadableResourceBundleMessageSource
body: <p>I am using ReloadableResourceBundleMessageSource to store value list of my system. So i can use the i18N functionality</p>
  
  <p>i am using multiple resources in the basenames of ReloadableResourceBundleMessageSource.
  I want to pass all the localized labels of the web UI to the client (front-end) in order to be cached locally at the client.
  Is there a way to load the entire keys of my resource bundles?</p>
  
  <p>here is my ReloadableResourceBundleMessageSource bean definition:</p>
  
  <pre><code>&lt;bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
      &lt;property name="basenames"&gt;
          &lt;list&gt;
              &lt;value&gt;classpath:resource1&lt;/value&gt;
              &lt;value&gt;classpath:resource2&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="cacheSeconds" value="60"/&gt;
      &lt;property name="defaultEncoding" value="UTF-8"/&gt;
      &lt;property name="useCodeAsDefaultMessage" value="true"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and this is my controller that pass all the keys:</p>
  
  <pre><code>@Component
  @RequestMapping("/bundle")
  public class ResourceBundleController {
  
      @Autowired
      private MessageSource messageSource;
  
      @RequestMapping(value = "/locales.js")
      public ModelAndView strings(HttpServletRequest request) {
  
          // Call the string.jsp view
          return new ModelAndView("/WEB-INF/includes/locales.jsp", "keys", ??? );// HERE IS MY PROBLEM. HOW SHOULD I GET ALL THE KEYS FROM MESSAGESOURCE
      }
  }
  </code></pre>
  
  <p>and here is my the resource bundle keys for the client:</p>
  
  <pre><code>&lt;%@page contentType="text/javascript" pageEncoding="UTF-8"%&gt;
  &lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;%@taglib prefix="spring" uri="http://www.springframework.org/tags"%&gt;
  
  var messages = {};
  
  &lt;c:forEach var="key" items="${keys}"&gt;
      messages["&lt;spring:message text='${key}' javaScriptEscape='true'/&gt;"] = "&lt;spring:message code='${key}' javaScriptEscape='true' /&gt;";
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Any help will be appreciated.</p>