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

  • Multiple Resource Bundles Dynamically Loaded

    Hello.

    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; messages.properties and messages_client.properties.

    My resource configuration looks like this:

    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename">
    <value>messages</value>
    </property>
    </bean>

    I will watch the thread. Thanks in advanced.

    Chris Rosenquest

    p.s.

    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
    Chris,

    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.

    Rob

    Comment

    Working...
    X