Child pages
  • text

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.

Description

Wiki Markup
{snippet:id=javadoc|javadoc=true|url=org.apache.struts2.components.Text}

Parameters

Wiki Markup
{snippet:id=tagattributes|javadoc=false|url=struts2-tags/text.html}

Examples

Wiki Markup
{snippet:id=exdescription|lang=none|javadoc=true|url=org.apache.struts2.components.Text}
Wiki Markup
{snippet:id=example|lang=xml|javadoc=true|url=org.apache.struts2.components.Text}

Other example

...


<s:text name="format.money"><s:param name="value" value="myMoneyValue"/></s:text>

...

For more details on using resource bundles with Struts 2 read the localization guide.

Parameters

...

Examples

...

Other example

...

where the following is in a regular (possibly locale-specific) properties file:

Code Block

format.money={0,number,currency}

...

For more about formatting text, see

...

If you wish to use i18n in your tag attributes

This will not work:

...

...


<s:textfield name="lastName" label="<s:text name="person.lastName"/>" ../>

Instead, you should use the getText() method that you inherit when your Action extends XWork's ActionSupport:

...


<s:textfield name="lastName" label="getText('person.lastName')" ../>

...