Announcement Announcement Module
Collapse
No announcement yet.
Using classpath* for resource bundles? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using classpath* for resource bundles?

    I've discovered that I can use something like this:
    Code:
    classpath*:/META-INF/bean.xml
    to have Spring load all bean.xml files found in any jars on the classpath. This is handy - but I'm wondering, can I do something like this:
    Code:
      <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basenames">
          <list>
            <value>classpath*&#58;/META-INF/messages</value>
          </list>
        </property>
      </bean>
    Will this work in my application context?

    Thanks,
    Andy

  • #2
    Andy,

    You do not need to use classpath*: as ResourceBundleMessageSource, by default, looks for resources in the entire classpath:
    Code:
      <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basenames">
          <list>
             <!--from jar1-->
            <value>ApplicationResources1</value>
             <!--from jar2-->
            <value>ApplicationResources2</value>
          </list>
        </property>
      </bean>
    HTH

    Comment

    Working...
    X