<ao:message>

Writes a value from the current localization bundle given its key. Writes the value with proper escaping based on the context of the tag.

Any number of "arg###" attributes may be provided, where ### is the substitution parameter index, starting at zero. For example, there could be arg0="First" arg1="Second" for two arguments. They will be passed-on to the message format.

Additionally, message substitution arguments may be provided by nested <ao:messageArg> tags.

These additional arguments will first fill-in any gap in the numeric ranges provided by "arg###" attributes. Because the first argument is zero, if arg1="Second" arg2="Third", then the first nested <ao:messageArg> would be applied filling the spot of arg0.

Once all gaps are filled, these additional arguments will be added after all provided as "arg###" attritutes.

This tag must be nested inside a <ao:bundle> tag.

The content type depends on the value provided to the type attribute, and defaults to text/plain. The content is checked for well-formedness based on its type:

  • css or text/css - must be well-formed CSS content. (Note: Currently only checks character values.)
  • javascript, application/javascript, or text/javascript - no validation
  • json or application/json - no validation
  • ld_json or application/ld+json - no validation
  • text or text/plain - no validation
  • url or text/url - must be a valid URL
  • xhtml or application/xhtml+xml - must be well-formed XHTML content. (Note: Currently only checks character values.)
  • xhtml_attribute or application/xhtml+xml+attribute - must be a valid XHTML attribute.
  • mysql or text/x+mysql - must be valid MySQL command "mysql" input
  • psql or text/x+psql - must be valid PostgreSQL command "psql" input
  • sh or text/x+sh - must be valid shell script

Tag Information

Tag Class: com.aoapps.taglib.legacy.MessageTag
TagExtraInfo Class: com.aoapps.taglib.MessageTagTEI
Body Content: JSP
Display Name: None
Dynamic Attributes: true

Attributes

Name Required Evaluation Type Description
bundle No Runtime String

The base name of resource bundle to access. When not provided, uses the currently active <ao:bundle>.

key Yes Runtime String

The key to lookup in the bundle. This key is appended to any prefix specified in the bundle.

arg0 No Runtime Object

The argument that will replace {0} in the message format.

Any number of arguments may be provided as attributes. The first four are added to TLD to help JSP code assist.

arg1 No Runtime Object

The argument that will replace {1} in the message format.

Any number of arguments may be provided as attributes. The first four are added to TLD to help JSP code assist.

arg2 No Runtime Object

The argument that will replace {2} in the message format.

Any number of arguments may be provided as attributes. The first four are added to TLD to help JSP code assist.

arg3 No Runtime Object

The argument that will replace {3} in the message format.

Any number of arguments may be provided as attributes. The first four are added to TLD to help JSP code assist.

type No Runtime Object

Specifies the type of content contained in the value. Defaults to text/plain. A nested <ao:type> tag will override this value.

Variables

No Variables Defined.