org.springframework.web.servlet.tags.form
Class AbstractHtmlElementTag

java.lang.Object
  extended by TagSupport
      extended by org.springframework.web.servlet.tags.RequestContextAwareTag
          extended by org.springframework.web.servlet.tags.HtmlEscapingAwareTag
              extended by org.springframework.web.servlet.tags.form.AbstractFormTag
                  extended by org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
                      extended by org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
All Implemented Interfaces:
EditorAwareTag
Direct Known Subclasses:
AbstractHtmlElementBodyTag, AbstractHtmlInputElementTag, FormTag, HiddenInputTag, LabelTag, OptionsTag

public abstract class AbstractHtmlElementTag
extends AbstractDataBoundFormElementTag

Base class for databinding-aware JSP tags that render HTML element. Provides a set of properties corresponding to the set of HTML attributes that are common across elements.

Additionally, this base class allows for rendering non-standard attributes as part of the tag's output. These attributes are accessible to subclasses if needed via the dynamicAttributes map.

Since:
2.0
Author:
Rob Harrop, Jeremy Grelle

Field Summary
static java.lang.String CLASS_ATTRIBUTE
           
private  java.lang.String cssClass
           
private  java.lang.String cssErrorClass
           
private  java.lang.String cssStyle
           
private  java.lang.String dir
           
static java.lang.String DIR_ATTRIBUTE
           
private  java.util.Map<java.lang.String,java.lang.Object> dynamicAttributes
           
private  java.lang.String lang
           
static java.lang.String LANG_ATTRIBUTE
           
private  java.lang.String onclick
           
static java.lang.String ONCLICK_ATTRIBUTE
           
private  java.lang.String ondblclick
           
static java.lang.String ONDBLCLICK_ATTRIBUTE
           
private  java.lang.String onkeydown
           
static java.lang.String ONKEYDOWN_ATTRIBUTE
           
private  java.lang.String onkeypress
           
static java.lang.String ONKEYPRESS_ATTRIBUTE
           
private  java.lang.String onkeyup
           
static java.lang.String ONKEYUP_ATTRIBUTE
           
private  java.lang.String onmousedown
           
static java.lang.String ONMOUSEDOWN_ATTRIBUTE
           
private  java.lang.String onmousemove
           
static java.lang.String ONMOUSEMOVE_ATTRIBUTE
           
private  java.lang.String onmouseout
           
static java.lang.String ONMOUSEOUT_ATTRIBUTE
           
private  java.lang.String onmouseover
           
static java.lang.String ONMOUSEOVER_ATTRIBUTE
           
private  java.lang.String onmouseup
           
static java.lang.String ONMOUSEUP_ATTRIBUTE
           
static java.lang.String STYLE_ATTRIBUTE
           
private  java.lang.String tabindex
           
static java.lang.String TABINDEX_ATTRIBUTE
           
private  java.lang.String title
           
static java.lang.String TITLE_ATTRIBUTE
           
 
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME
 
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
 
Constructor Summary
AbstractHtmlElementTag()
           
 
Method Summary
protected  java.lang.String getCssClass()
          Get the value of the 'class' attribute.
protected  java.lang.String getCssErrorClass()
          The CSS class to use when the field bound to a particular tag has errors.
protected  java.lang.String getCssStyle()
          Get the value of the 'style' attribute.
protected  java.lang.String getDir()
          Get the value of the 'dir' attribute.
protected  java.util.Map<java.lang.String,java.lang.Object> getDynamicAttributes()
          Get the map of dynamic attributes.
protected  java.lang.String getLang()
          Get the value of the 'lang' attribute.
protected  java.lang.String getOnclick()
          Get the value of the 'onclick' attribute.
protected  java.lang.String getOndblclick()
          Get the value of the 'ondblclick' attribute.
protected  java.lang.String getOnkeydown()
          Get the value of the 'onkeydown' attribute.
protected  java.lang.String getOnkeypress()
          Get the value of the 'onkeypress' attribute.
protected  java.lang.String getOnkeyup()
          Get the value of the 'onkeyup' attribute.
protected  java.lang.String getOnmousedown()
          Get the value of the 'onmousedown' attribute.
protected  java.lang.String getOnmousemove()
          Get the value of the 'onmousemove' attribute.
protected  java.lang.String getOnmouseout()
          Get the value of the 'onmouseout' attribute.
protected  java.lang.String getOnmouseover()
          Get the value of the 'onmouseover' attribute.
protected  java.lang.String getOnmouseup()
          Get the value of the 'onmouseup' attribute.
protected  java.lang.String getTabindex()
          Get the value of the 'tabindex' attribute.
protected  java.lang.String getTitle()
          Get the value of the 'title' attribute.
protected  java.lang.String resolveCssClass()
          Gets the appropriate CSS class to use based on the state of the current BindStatus object.
 void setCssClass(java.lang.String cssClass)
          Set the value of the 'class' attribute.
 void setCssErrorClass(java.lang.String cssErrorClass)
          The CSS class to use when the field bound to a particular tag has errors.
 void setCssStyle(java.lang.String cssStyle)
          Set the value of the 'style' attribute.
 void setDir(java.lang.String dir)
          Set the value of the 'dir' attribute.
 void setDynamicAttribute(java.lang.String uri, java.lang.String localName, java.lang.Object value)
          
 void setLang(java.lang.String lang)
          Set the value of the 'lang' attribute.
 void setOnclick(java.lang.String onclick)
          Set the value of the 'onclick' attribute.
 void setOndblclick(java.lang.String ondblclick)
          Set the value of the 'ondblclick' attribute.
 void setOnkeydown(java.lang.String onkeydown)
          Set the value of the 'onkeydown' attribute.
 void setOnkeypress(java.lang.String onkeypress)
          Set the value of the 'onkeypress' attribute.
 void setOnkeyup(java.lang.String onkeyup)
          Set the value of the 'onkeyup' attribute.
 void setOnmousedown(java.lang.String onmousedown)
          Set the value of the 'onmousedown' attribute.
 void setOnmousemove(java.lang.String onmousemove)
          Set the value of the 'onmousemove' attribute.
 void setOnmouseout(java.lang.String onmouseout)
          Set the value of the 'onmouseout' attribute.
 void setOnmouseover(java.lang.String onmouseover)
          Set the value of the 'onmouseover' attribute.
 void setOnmouseup(java.lang.String onmouseup)
          Set the value of the 'onmouseup' attribute.
 void setTabindex(java.lang.String tabindex)
          Set the value of the 'tabindex' attribute.
 void setTitle(java.lang.String title)
          Set the value of the 'title' attribute.
protected  void writeDefaultAttributes(TagWriter tagWriter)
          Writes the default attributes configured via this base class to the supplied TagWriter.
protected  void writeOptionalAttributes(TagWriter tagWriter)
          Writes the optional attributes configured via this base class to the supplied TagWriter.
 
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, convertToDisplayString, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId, setPath
 
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute, writeTagContent
 
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
 
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_ATTRIBUTE

public static final java.lang.String CLASS_ATTRIBUTE
See Also:
Constant Field Values

STYLE_ATTRIBUTE

public static final java.lang.String STYLE_ATTRIBUTE
See Also:
Constant Field Values

LANG_ATTRIBUTE

public static final java.lang.String LANG_ATTRIBUTE
See Also:
Constant Field Values

TITLE_ATTRIBUTE

public static final java.lang.String TITLE_ATTRIBUTE
See Also:
Constant Field Values

DIR_ATTRIBUTE

public static final java.lang.String DIR_ATTRIBUTE
See Also:
Constant Field Values

TABINDEX_ATTRIBUTE

public static final java.lang.String TABINDEX_ATTRIBUTE
See Also:
Constant Field Values

ONCLICK_ATTRIBUTE

public static final java.lang.String ONCLICK_ATTRIBUTE
See Also:
Constant Field Values

ONDBLCLICK_ATTRIBUTE

public static final java.lang.String ONDBLCLICK_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEDOWN_ATTRIBUTE

public static final java.lang.String ONMOUSEDOWN_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEUP_ATTRIBUTE

public static final java.lang.String ONMOUSEUP_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEOVER_ATTRIBUTE

public static final java.lang.String ONMOUSEOVER_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEMOVE_ATTRIBUTE

public static final java.lang.String ONMOUSEMOVE_ATTRIBUTE
See Also:
Constant Field Values

ONMOUSEOUT_ATTRIBUTE

public static final java.lang.String ONMOUSEOUT_ATTRIBUTE
See Also:
Constant Field Values

ONKEYPRESS_ATTRIBUTE

public static final java.lang.String ONKEYPRESS_ATTRIBUTE
See Also:
Constant Field Values

ONKEYUP_ATTRIBUTE

public static final java.lang.String ONKEYUP_ATTRIBUTE
See Also:
Constant Field Values

ONKEYDOWN_ATTRIBUTE

public static final java.lang.String ONKEYDOWN_ATTRIBUTE
See Also:
Constant Field Values

cssClass

private java.lang.String cssClass

cssErrorClass

private java.lang.String cssErrorClass

cssStyle

private java.lang.String cssStyle

lang

private java.lang.String lang

title

private java.lang.String title

dir

private java.lang.String dir

tabindex

private java.lang.String tabindex

onclick

private java.lang.String onclick

ondblclick

private java.lang.String ondblclick

onmousedown

private java.lang.String onmousedown

onmouseup

private java.lang.String onmouseup

onmouseover

private java.lang.String onmouseover

onmousemove

private java.lang.String onmousemove

onmouseout

private java.lang.String onmouseout

onkeypress

private java.lang.String onkeypress

onkeyup

private java.lang.String onkeyup

onkeydown

private java.lang.String onkeydown

dynamicAttributes

private java.util.Map<java.lang.String,java.lang.Object> dynamicAttributes
Constructor Detail

AbstractHtmlElementTag

public AbstractHtmlElementTag()
Method Detail

setCssClass

public void setCssClass(java.lang.String cssClass)
Set the value of the 'class' attribute. May be a runtime expression.


getCssClass

protected java.lang.String getCssClass()
Get the value of the 'class' attribute. May be a runtime expression.


setCssErrorClass

public void setCssErrorClass(java.lang.String cssErrorClass)
The CSS class to use when the field bound to a particular tag has errors. May be a runtime expression.


getCssErrorClass

protected java.lang.String getCssErrorClass()
The CSS class to use when the field bound to a particular tag has errors. May be a runtime expression.


setCssStyle

public void setCssStyle(java.lang.String cssStyle)
Set the value of the 'style' attribute. May be a runtime expression.


getCssStyle

protected java.lang.String getCssStyle()
Get the value of the 'style' attribute. May be a runtime expression.


setLang

public void setLang(java.lang.String lang)
Set the value of the 'lang' attribute. May be a runtime expression.


getLang

protected java.lang.String getLang()
Get the value of the 'lang' attribute. May be a runtime expression.


setTitle

public void setTitle(java.lang.String title)
Set the value of the 'title' attribute. May be a runtime expression.


getTitle

protected java.lang.String getTitle()
Get the value of the 'title' attribute. May be a runtime expression.


setDir

public void setDir(java.lang.String dir)
Set the value of the 'dir' attribute. May be a runtime expression.


getDir

protected java.lang.String getDir()
Get the value of the 'dir' attribute. May be a runtime expression.


setTabindex

public void setTabindex(java.lang.String tabindex)
Set the value of the 'tabindex' attribute. May be a runtime expression.


getTabindex

protected java.lang.String getTabindex()
Get the value of the 'tabindex' attribute. May be a runtime expression.


setOnclick

public void setOnclick(java.lang.String onclick)
Set the value of the 'onclick' attribute. May be a runtime expression.


getOnclick

protected java.lang.String getOnclick()
Get the value of the 'onclick' attribute. May be a runtime expression.


setOndblclick

public void setOndblclick(java.lang.String ondblclick)
Set the value of the 'ondblclick' attribute. May be a runtime expression.


getOndblclick

protected java.lang.String getOndblclick()
Get the value of the 'ondblclick' attribute. May be a runtime expression.


setOnmousedown

public void setOnmousedown(java.lang.String onmousedown)
Set the value of the 'onmousedown' attribute. May be a runtime expression.


getOnmousedown

protected java.lang.String getOnmousedown()
Get the value of the 'onmousedown' attribute. May be a runtime expression.


setOnmouseup

public void setOnmouseup(java.lang.String onmouseup)
Set the value of the 'onmouseup' attribute. May be a runtime expression.


getOnmouseup

protected java.lang.String getOnmouseup()
Get the value of the 'onmouseup' attribute. May be a runtime expression.


setOnmouseover

public void setOnmouseover(java.lang.String onmouseover)
Set the value of the 'onmouseover' attribute. May be a runtime expression.


getOnmouseover

protected java.lang.String getOnmouseover()
Get the value of the 'onmouseover' attribute. May be a runtime expression.


setOnmousemove

public void setOnmousemove(java.lang.String onmousemove)
Set the value of the 'onmousemove' attribute. May be a runtime expression.


getOnmousemove

protected java.lang.String getOnmousemove()
Get the value of the 'onmousemove' attribute. May be a runtime expression.


setOnmouseout

public void setOnmouseout(java.lang.String onmouseout)
Set the value of the 'onmouseout' attribute. May be a runtime expression.


getOnmouseout

protected java.lang.String getOnmouseout()
Get the value of the 'onmouseout' attribute. May be a runtime expression.


setOnkeypress

public void setOnkeypress(java.lang.String onkeypress)
Set the value of the 'onkeypress' attribute. May be a runtime expression.


getOnkeypress

protected java.lang.String getOnkeypress()
Get the value of the 'onkeypress' attribute. May be a runtime expression.


setOnkeyup

public void setOnkeyup(java.lang.String onkeyup)
Set the value of the 'onkeyup' attribute. May be a runtime expression.


getOnkeyup

protected java.lang.String getOnkeyup()
Get the value of the 'onkeyup' attribute. May be a runtime expression.


setOnkeydown

public void setOnkeydown(java.lang.String onkeydown)
Set the value of the 'onkeydown' attribute. May be a runtime expression.


getOnkeydown

protected java.lang.String getOnkeydown()
Get the value of the 'onkeydown' attribute. May be a runtime expression.


getDynamicAttributes

protected java.util.Map<java.lang.String,java.lang.Object> getDynamicAttributes()
Get the map of dynamic attributes.


setDynamicAttribute

public void setDynamicAttribute(java.lang.String uri,
                                java.lang.String localName,
                                java.lang.Object value)
                         throws JspException

Throws:
JspException

writeDefaultAttributes

protected void writeDefaultAttributes(TagWriter tagWriter)
                               throws JspException
Writes the default attributes configured via this base class to the supplied TagWriter. Subclasses should call this when they want the base attribute set to be written to the output.

Overrides:
writeDefaultAttributes in class AbstractDataBoundFormElementTag
Parameters:
tagWriter - the TagWriter to which any attributes are to be written
Throws:
JspException

writeOptionalAttributes

protected void writeOptionalAttributes(TagWriter tagWriter)
                                throws JspException
Writes the optional attributes configured via this base class to the supplied TagWriter. The set of optional attributes that will be rendered includes any non-standard dynamic attributes. Called by writeDefaultAttributes(TagWriter).

Throws:
JspException

resolveCssClass

protected java.lang.String resolveCssClass()
                                    throws JspException
Gets the appropriate CSS class to use based on the state of the current BindStatus object.

Throws:
JspException