Announcement Announcement Module
No announcement yet.
Multiple Resource Bundles Dynamically Loaded Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Resource Bundles Dynamically Loaded


    I'm trying to figure out why I cannot read multiple resource bundles in my Spring app.

    I'm under the impression that all resources written in my application classpath with the file pattern "messages*" will be read as a resource upon start-up of my application.

    For example: I want my app to draw messages from two bundles; and

    My resource configuration looks like this:

    <bean id="messageSource" class=" eBundleMessageSource">
    <property name="basename">

    I will watch the thread. Thanks in advanced.

    Chris Rosenquest


    My experience with Spring is good so far. I haven't had major issues getting it working. It did take a bit of time trying to understand the IoC stuff but that was quickly accomplished looking through the petclinic examples. Compared to the time it took my to ramp up to Struts, it was about 75% longer to ramp up on Spring. I do have questions about transaction pooling but I haven't done much research yet. That's another thread.[/code]

  • #2

    The ResourceBundle class, that is used by ResourceBundleMessageSource is a standard part of Java. It looks for messages using very specific semantics based on the current Locale. You should check out the JavaDocs for ResourceBundle.

    For what you want, you may be better off creating your own MessageSource implementation that ignores the Locale and instead looks inside the two files you specified. You should look at the AbstractMessageSource as a base.