Writes the bean contents. Supports data types beyond <c:out> and <bean:write>, such as XML nodes for HTML snippets.

If the bean is null then nothing is displayed. This is generally for compatibility with Struts 1.X and predates JSTL and Expression Language. JSTL, Expression Language, and other tags should generally be preferred.

The method attribute provides the name of the method that will be used to get the display value. If not provided, it will default to toString. This method searches for the method of the given name with no parameters. It is an error if the method is not found.

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:

  • 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.

Tag Information

Tag Class: com.aoindustries.taglib.WriteTag
TagExtraInfo Class: com.aoindustries.taglib.WriteTagTEI
Body Content: scriptless
Display Name: None


Name Required Evaluation Type Description
scope No Static String

Specifies the variable scope searched to retrieve the bean specified by name. If not specified, the default rules applied by JspContext.findAttribute() are applied.

name No Static Object

Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be used.

A nested <ao:name> tag will override this value.

property No Runtime String

Specifies the name of the property to be accessed on the bean specified by name. This value may be a simple, indexed, or nested property reference expression. If not specified, the bean identified by name will itself be used.

method No Static String

Specifies the method that will be used to convert the object to a String. This defaults to toString.

type No Static Object

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


No Variables Defined.