AO Taglib Reference

Making JSP what it should have been all along.

Usage

Standard Syntax

<%@ taglib prefix="ao" uri="https://aoindustries.com/ao-taglib/" %>

XML Syntax

<anyxmlelement xmlns:ao="https://aoindustries.com/ao-taglib/" />

Tag Library Information

Display Name: AO Taglib
Version: 2.3.1
Short Name: ao
URI: https://aoindustries.com/ao-taglib/

Tag Summary

<ao:a>

Renders an <a> tag.

<ao:action>

Provides an action to its ActionAttribute parent tag.

<ao:alt>

Provides an alt attribute to its AltAttribute parent tag.

<ao:arg>

Adds an argument to its ArgsAttribute parent tag.

<ao:assert>

Evaluates the test expression, if it is not true throws AssertionError with the optional message.

<ao:base>

Adds a <base> tag only when necessary.

<ao:bundle>

Sets the bundle used by any nested <ao:message> tags or functions.

<ao:checked>

Provides a checked attribute to its CheckedAttribute parent tag. The body, after trimming, must contain either true, false, or be empty. If empty, the checked attribute of the parent tag is not overridden.

<ao:choose>

Like <c:choose>, except uses deferred expressions.

<ao:class>

Provides a class to its ClassAttribute parent tag.

<ao:content>

Provides a content attribute to its ContentAttribute parent tag.

<ao:disableResourceEditor>

Disables the resource editor for this request.

<ao:disabled>

Provides a disabled attribute to its DisabledAttribute parent tag. The body, after trimming, must contain either true, false, or be empty. If empty, the disabled attribute of the parent tag is not overridden.

<ao:enctype>

Provides an enctype to its EnctypeAttribute parent tag.

<ao:form>

Renders a <form> tag.

<ao:forward>

Forwards to another resource. Stops processing of the containing JSP page. This has three advantages over the standard <jsp:forward> tag:

  1. You may clear parameters such that only those specifically added will be passed on to the next page
  2. You may have other nested tags used to select and build the set of parameters
  3. You may pass argument objects instead of only String parameters (see below)
<ao:frameborder>

Provides a frameborder attribute to its FrameborderAttribute parent tag. The body, after trimming, must contain either true, false, or be empty. If empty, the frameborder attribute of the parent tag is not overridden.

<ao:getStackTraces>

Gets a detailed report of a Throwable as generated by ErrorPrinter.

The content type of this tag is text/plain.

<ao:height>

Provides a height attribute to its HeightAttribute parent tag.

<ao:html>
  1. Clears the current output buffer (leaving status code and headers)
  2. Sets the response contentType between html / xhtml based on forceHtml attribute and request headers
  3. Writes the DOCTYPE unless set to "none"
  4. Writes the <html> tag, including the xmlns, lang, and xml:lang attributes based on the locale of the current response.
<ao:href>

Provides an href to its HrefAttribute parent tag.

<ao:hreflang>

Provides an hreflang attribute to its HreflangAttribute parent tag.

<ao:id>

Provides an id attribute to its IdAttribute parent tag.

<ao:iframe>

Renders an <iframe> tag.

<ao:img>

Renders an <img> tag.

<ao:include>

Includes another resource and then continues processing of the current JSP page. This has three advantages over the standard <jsp:include> tag:

  1. You may clear parameters such that only those specifically added will be passed on to the included page
  2. You may have other nested tags used to select and build the set of parameters
  3. You may pass argument objects instead of only String parameters (see below)
<ao:input>

Renders an <input> tag.

<ao:link>

If contained with any LinksAttribute parent, adds the link data to the parent tag. Otherwise, renders a <link> tag.

<ao:maxlength>

Provides a maxlength attribute to its MaxlengthAttribute parent tag. The body is trimmed. If empty is sets the maxlength to null. Otherwise it must be a valid integer.

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

<ao:messageArg>

Adds a message argument to its MessageArgsAttribute parent tag.

<ao:meta>

If contained with any MetasAttribute parent, adds the meta data to the parent tag. Otherwise, renders a <meta> tag.

<ao:method>

Provides a method attribute to its MethodAttribute parent tag.

<ao:name>

Provides a name to its NameAttribute parent tag.

<ao:onblur>

Provides an onblur script to its OnblurAttribute parent tag.

<ao:onchange>

Provides an onchange script to its OnchangeAttribute parent tag.

<ao:onclick>

Provides an onclick script to its OnclickAttribute parent tag.

<ao:onfocus>

Provides an onfocus script to its OnfocusAttribute parent tag.

<ao:onkeypress>

Provides an onkeypress script to its OnkeypressAttribute parent tag.

<ao:onload>

Provides an onload script to its OnloadAttribute parent tag.

<ao:onmouseout>

Provides an onmouseout script to its OnmouseoutAttribute parent tag.

<ao:onmouseover>

Provides an onmouseover script to its OnmouseoverAttribute parent tag.

<ao:onsubmit>

Provides an onsubmit script to its OnsubmitAttribute parent tag.

<ao:option>

Renders an <option> tag.

<ao:otherwise>

Like <c:otherwise>, except uses deferred expressions.

<ao:out>

Writes the value with proper escaping based on the context of the tag. Supports data types beyond <c:out>.

<ao:page>

Provides a page to its PageAttribute parent tag.

<ao:param>

Adds a parameter to its ParamsAttribute parent tag.

<ao:params>

Adds multiple parameters to its ParamsAttribute parent tag.

<ao:readonly>

Provides a readonly attribute to its ReadonlyAttribute parent tag.

<ao:redirect>

Redirects the browser to another location. Stops processing of the containing JSP page.

Important: Redirects inside of standard <jsp:include> tags will be silently lost. Use <ao:include> instead of <jsp:include> to support redirects inside of includes.

<ao:rel>

Provides a rel attribute to its RelAttribute parent tag.

<ao:resourceEditor>

Allows editing of the website resource bundles through the website itself.

<ao:script>

Manually establishes a script context when automatic detection is not possible. The body of this tag contains a script.

<ao:select>

Renders a <select> tag.

<ao:selected>

Provides a selected attribute to its SelectedAttribute parent tag.

<ao:sendError>

Returns an error status. Stops processing of the containing JSP page. Results in error handler processing.

Important: Errors sent inside of standard <jsp:include> tags will be silently lost. Use <ao:include> instead of <jsp:include> to support sendError inside of includes.

<ao:size>

Provides a size attribute to its SizeAttribute parent tag.

<ao:src>

Provides a src attribute to its SrcAttribute parent tag.

<ao:style>

Provides a style attribute to its StyleAttribute parent tag.

<ao:tabindex>

Provides a tabindex attribute to its TabindexAttribute parent tag.

<ao:target>

Provides a target attribute to its TargetAttribute parent tag.

<ao:text>

Manually establishes a plaintext context when automatic detection is not possible. The body of this tag contains any arbitary plain text.

<ao:textarea>

Renders a <textarea> tag.

<ao:title>

Provides a title to its TitleAttribute parent tag.

<ao:type>

Provides a type to its TypeAttribute parent tag.

<ao:url>

Manually establishes a URL context when automatic detection is not possible. The body of this tag contains a Uniform Resource Identifier (URI or URL).

<ao:value>

Provides a value to its ValueAttribute parent tag.

<ao:when>

Like <c:when>, except uses deferred expressions.

<ao:width>

Provides a width attribute to its WidthAttribute parent tag.

<ao:wordWrap>

Word wraps the textual content.

<ao:write>

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

<ao:xhtmlAttribute>

Manually establishes an XHTML attribute context when automatic detection is not possible. The body of this tag contains well-formed XHTML 1.0-compliant attribute.

<ao:xhtml>

Manually establishes an XHTML context when automatic detection is not possible. The body of this tag contains well-formed XHTML 1.0-compliant markup.

Function Summary

long ${ao:getLastModified(String)}

Gets the lastModified timestamp in milliseconds since Epoch or 0 when not known.

String ${ao:addLastModified(String)}

If the URL represents a local resource, a parameter of "lastModified=#####" will be automatically added with the timestamp of the local resource to the nearest second.

String ${ao:encodeURL(String)}

Rewrites a URL to maintain session state via HttpServletResponse.encodeURL.

String ${ao:getAbsoluteURL(String)}

Generates an absolute URL for the provided context-relative URL. The URL is not automatically response encodeURL.

String ${ao:getDecimalTimeLength(Long)}

Gets a time span display for a given number of milliseconds or null for null milliseconds.

boolean ${ao:isForwarded()}

Determines if the current request has been forwarded by a <ao:forward> or <ao:redirect> tag.

String ${ao:join(Iterable, String)}

Joins elements of any Iterable into a String.

String ${ao:message(String)}

Gets a value from the current localization bundle given its key. No parameters may be provided. Must be nested inside a <ao:bundle> tag.

String ${ao:wordWrap(String, int)}

Word wraps a String.

double ${ao:ceil(double)}

Calls java.lang.Math.ceil(double).

double ${ao:floor(double)}

Calls java.lang.Math.floor(double).

long ${ao:round(double)}

Calls java.lang.Math.round(double).