Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2151

ActionMessage should include option for bundle

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.1.0
    • 1.4.x
    • Tag Libraries
    • None
    • Operating System: other
      Platform: Other
    • 30401

    Description

      In an Action it is not possible to declare what resource bundle an ActionMessage
      should come from. The ActionMessage class should include an optional property
      to declare the name of the property file/ResourceBundle to get the value from.

      In your struts-config.xml if you have defined a message resource like the following.

      <message-resources
      key="error_resources"
      parameter="org.apache.resource.error" null="false"/>

      You should be to create an ActionMessage as follows
      ActionMessage am = new ActionMessage("error_resources", "login.failed");

      This would use the "error_resources" bundle to lookup the key "login.failed"
      instead of the default global resource bundle.

      Additionally, the MessagesTag.java would have to change in the doAfterBody
      method (~line 308 revision 1.16) in order to support the new functionality.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cmercer@charter.net Chris Mercer
              Votes:
              3 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: