title: Adding folder to classpath in Velocity using Spring framework
body: <p>How can I add an entire folder to Velocity and use the files inside as resource bundles?</p>
  
  <p>Currently in my velocity.xml I have this code:</p>
  
  <pre><code>&lt;bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
      &lt;property name="parentMessageSource"&gt;
        &lt;ref bean="globMessageSource"/&gt;
      &lt;/property&gt;
      &lt;property name="basenames"&gt;
        &lt;list&gt; 
          &lt;value&gt;classpath:/WEB-INF/i18n&lt;/value&gt;
          &lt;value&gt;/WEB-INF/templates/velocity/my_vm_template&lt;/value&gt;
     &lt;/list&gt; 
  &lt;/bean&gt;
  </code></pre>
  
  <p>I need to add i18n folder to the classpath so that its containing files can be seen by the VelocityTools version 1.4 in the toolbox.xml:</p>
  
  <pre><code> &lt;tool&gt;
     &lt;key&gt;test&lt;/key&gt;
     &lt;scope&gt;request&lt;/scope&gt;
     &lt;class&gt;org.apache.velocity.tools.generic.ResourceTool&lt;/class&gt;
     &lt;parameter name="bundles" value="i18n.ss_messages"/&gt;
     &lt;parameter name="locale" value="en_US"/&gt;
   &lt;/tool&gt;
  </code></pre>
  
  <p>The code is giving me an error message: "java.util.MissingResourceException: Can't find bundle for base name i18n.ss_messages, locale en_US"</p>
  
  <p>This question relates to <a href="https://stackoverflow.com/questions/8221161/velocitytools-error-java-util-missingresourceexception-cant-find-bundle-for">VelocityTools error - &quot;java.util.MissingResourceException: Can&#39;t find bundle for base name WEB-INF.conf.resources.ss_messages, locale en_US&quot;</a></p>
  
  <p>Sorry if it's a silly question, but I can't find anywhere describing how to add an entire folder to the classpath and be available as a bundle so it can support Velocity template localization.</p>
  
  <p><strong>IMPORTANT NOTE!!</strong> If I place my ss_messages_bg_BG.properties and ss_messages_en_US.properties files in /WEB-INF/classes/i18n then it works, but I want to place them in a different folder ideally in /WEB-INF/templates/i18n. How do I do that?</p>