<ao:write>

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:

  • 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.WriteTag
TagExtraInfo Class: com.aoapps.taglib.WriteTagTEI
Body Content: scriptless
Display Name: None

Attributes

Name Required Evaluation Type Description
scope No Runtime 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 Runtime 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 Runtime String

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

type No Runtime Object

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

Variables

No Variables Defined.