Results 1 to 2 of 2

Thread: Using classpath* for resource bundles?

  1. #1
    Join Date
    Aug 2004
    Posts
    229

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    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
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Similar Threads

  1. Replies: 11
    Last Post: Mar 27th, 2007, 02:18 AM
  2. Replies: 1
    Last Post: Jul 14th, 2005, 09:50 AM
  3. Replies: 3
    Last Post: May 6th, 2005, 08:11 AM
  4. Resource Bundles, Properies or Interfaces?
    By fiacobelli in forum Architecture
    Replies: 1
    Last Post: Feb 16th, 2005, 05:11 PM
  5. Multiple Resource Bundles Dynamically Loaded
    By frozenquest in forum Web
    Replies: 1
    Last Post: Jan 27th, 2005, 04:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •