public abstract class

AbstractFormTag

extends HtmlEscapingAwareTag
java.lang.Object
   ↳ TagSupport
     ↳ org.springframework.web.servlet.tags.RequestContextAwareTag
       ↳ org.springframework.web.servlet.tags.HtmlEscapingAwareTag
         ↳ org.springframework.web.servlet.tags.form.AbstractFormTag
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Base class for all JSP form tags. Provides utility methods for null-safe EL evaluation and for accessing and working with a TagWriter.

Subclasses should implement the writeTagContent(TagWriter) to perform actual tag rendering.

Subclasses (or test classes) can override the createTagWriter() method to redirect output to a Writer other than the javax.servlet.jsp.JspWriter associated with the current javax.servlet.jsp.PageContext.

Summary

[Expand]
Inherited Constants
From class org.springframework.web.servlet.tags.RequestContextAwareTag
[Expand]
Inherited Fields
From class org.springframework.web.servlet.tags.RequestContextAwareTag
Public Constructors
AbstractFormTag()
Protected Methods
TagWriter createTagWriter()
Create the TagWriter which all output will be written to.
final int doStartTagInternal()
Provide a simple template method that calls createTagWriter() and passes the created TagWriter to the writeTagContent(TagWriter) method.
Object evaluate(String attributeName, Object value)
Evaluate the supplied value for the supplied attribute name.
boolean evaluateBoolean(String attributeName, String value)
Evaluate the supplied value for the supplied attribute name.
String getDisplayString(Object value, PropertyEditor propertyEditor)
Get the display value of the supplied Object, HTML escaped as required.
String getDisplayString(Object value)
Get the display value of the supplied Object, HTML escaped as required.
boolean isDefaultHtmlEscape()
Overridden to default to true in case of no explicit default given.
final void writeOptionalAttribute(TagWriter tagWriter, String attributeName, String value)
Optionally writes the supplied value under the supplied attribute name into the supplied TagWriter.
abstract int writeTagContent(TagWriter tagWriter)
Subclasses should implement this method to perform tag content rendering.
[Expand]
Inherited Methods
From class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
From class org.springframework.web.servlet.tags.RequestContextAwareTag
From class java.lang.Object

Public Constructors

public AbstractFormTag ()

Protected Methods

protected TagWriter createTagWriter ()

Create the TagWriter which all output will be written to. By default, the TagWriter writes its output to the javax.servlet.jsp.JspWriter for the current javax.servlet.jsp.PageContext. Subclasses may choose to change the Writer to which output is actually written.

protected final int doStartTagInternal ()

Provide a simple template method that calls createTagWriter() and passes the created TagWriter to the writeTagContent(TagWriter) method.

Returns
Throws
Exception

protected Object evaluate (String attributeName, Object value)

Evaluate the supplied value for the supplied attribute name. If the supplied value is null then null is returned, otherwise evaluation is handled using ExpressionEvaluationUtils#evaluate(String, String, javax.servlet.jsp.PageContext).

Throws
JspException

protected boolean evaluateBoolean (String attributeName, String value)

Evaluate the supplied value for the supplied attribute name. If the supplied value is null then false is returned, otherwise evaluation is handled using ExpressionEvaluationUtils#evaluate(String, String, javax.servlet.jsp.PageContext), with subsequent matching against Boolean.TRUE and Boolean.valueOf.

Throws
JspException

protected String getDisplayString (Object value, PropertyEditor propertyEditor)

Get the display value of the supplied Object, HTML escaped as required. If the supplied value is not a String and the supplied PropertyEditor is not null then the PropertyEditor is used to obtain the display value.

protected String getDisplayString (Object value)

Get the display value of the supplied Object, HTML escaped as required. This version is not PropertyEditor-aware.

protected boolean isDefaultHtmlEscape ()

Overridden to default to true in case of no explicit default given.

protected final void writeOptionalAttribute (TagWriter tagWriter, String attributeName, String value)

Optionally writes the supplied value under the supplied attribute name into the supplied TagWriter. In this case, the supplied value is evaluated first and then the String representation is written as the attribute value. If the resultant String representation is null or empty, no attribute is written.

Throws
JspException

protected abstract int writeTagContent (TagWriter tagWriter)

Subclasses should implement this method to perform tag content rendering.

Returns
  • valid tag render instruction as per javax.servlet.jsp.tagext.Tag#doStartTag().
Throws
JspException