Render a I18n text message.
The message must be in a resource bundle with the same name as the action that it is associated with. In practice this means that you should create a properties file in the same package as your Java class with the same name as your class, but with .properties extension.
If the named message is not found in a property file, then the body of the tag will be used as default message. If no body is used, then the stack will be searched, and if a value is returned, it will written to the output. If no value is found on the stack, the key of the message will be written out.
- name* (String) - the i18n message key
Example:
Accessing messages from a given bundle (the i18n Shop example bundle in the first example) and using bundle defined through the framework in the second example.
<!-- First Example --> <s:i18n name="struts.action.test.i18n.Shop"> <s:text name="main.title"/> </s:i18n> <!-- Second Example --> <s:text name="main.title" /> <!-- Third Examlpe --> <s:text name="i18n.label.greetings"> <s:param >Mr Smith</s:param> </s:text>
<-- Fourth Example --> <s:text name="some.key" /> <-- Fifth Example --> <s:text name="some.invalid.key" > The Default Message That Will Be Displayed </s:text>
@see Param