Announcement Announcement Module
Collapse
No announcement yet.
how can I configure the flow-specific message source Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how can I configure the flow-specific message source

    A file named 'messages.properties' can be positioned inside the flow's working directory to provide flow-specific messages.
    A ReloadableResourceBundleMessageSource is created for that internally.

    Can I somehow configure that message source (e.g. p:useCodeAsDefaultMessage="true") or even specify my own implementation?

  • #2
    bean-import

    Hi tisch,

    if you have a bean-import and it contains a local bean called "messageSource" it will be used instead of the "messages.properties". Thus you can configure it yourself.

    Henning

    Comment


    • #3
      Thank you. This works - but unfortunately not completely as I expected.

      If a messageSource is not explicitly imported into the flow spring automatically creates one with messages.properties in the same directory as it's basename. It's parent message source is set to be the web application context.
      So, if a message can not be found the parent message source can be asked. If it can not be found there either the root application context is asked.

      In the end I like the fact that a flow-specific messages.properties in the flow's working directory can be used.
      But if I specify an other message source to be used the hierarchy is broken and the flow-specific messages.properties is left out.

      What I would like to do is to control which class is used for the automatically created message source and how it is configured.

      Comment


      • #4
        If you configure your MessageSource be sure to set the parent message source
        Code:
            <property name="parentMessageSource">
              <ref parent="messageSource"/>
            </property>
        and give yours the id messageSource! If you want to use the standard way there is no way to set other properties.

        Comment


        • #5
          Thanks for useful information. It works.

          Comment

          Working...
          X