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

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
                          extended by org.springframework.web.servlet.tags.form.ButtonTag
All Implemented Interfaces:
EditorAwareTag

public class ButtonTag
extends AbstractHtmlElementTag

An HTML button tag. This tag is provided for completeness if the application relies on a RequestDataValueProcessor.

Since:
3.1
Author:
Rossen Stoyanchev

Field Summary
private  java.lang.String disabled
           
static java.lang.String DISABLED_ATTRIBUTE
          The name of the 'disabled' attribute.
private  java.lang.String name
           
private  TagWriter tagWriter
           
private  java.lang.String value
           
 
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, 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
ButtonTag()
           
 
Method Summary
 int doEndTag()
          Closes the 'button' block tag.
protected  java.lang.String getDefaultValue()
          Return the default value.
 java.lang.String getDisabled()
          Get the value of the 'disabled' attribute.
 java.lang.String getName()
          Set the value of the 'name' attribute.
protected  java.lang.String getType()
          Get the value of the 'type' attribute.
 java.lang.String getValue()
          Get the value of the 'value' attribute.
protected  boolean isDisabled()
          Is the current HTML tag disabled?
 void setDisabled(java.lang.String disabled)
          Set the value of the 'disabled' attribute.
 void setName(java.lang.String name)
          Get the value of the 'name' attribute.
 void setValue(java.lang.String value)
          Set the value of the 'value' attribute.
protected  int writeTagContent(TagWriter tagWriter)
          Subclasses should implement this method to perform tag content rendering.
protected  void writeValue(TagWriter tagWriter)
          Writes the 'value' attribute to the supplied TagWriter.
 
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
getCssClass, getCssErrorClass, getCssStyle, getDir, getDynamicAttributes, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, isValidDynamicAttribute, resolveCssClass, setCssClass, setCssErrorClass, setCssStyle, setDir, setDynamicAttribute, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes
 
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, convertToDisplayString, doFinally, getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, processFieldValue, resolveId, setId, setPath
 
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, evaluateBoolean, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute
 
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

DISABLED_ATTRIBUTE

public static final java.lang.String DISABLED_ATTRIBUTE
The name of the 'disabled' attribute.

See Also:
Constant Field Values

tagWriter

private TagWriter tagWriter

name

private java.lang.String name

value

private java.lang.String value

disabled

private java.lang.String disabled
Constructor Detail

ButtonTag

public ButtonTag()
Method Detail

getName

public java.lang.String getName()
Set the value of the 'name' attribute.

Overrides:
getName in class AbstractDataBoundFormElementTag
Returns:
the value for the HTML 'name' attribute

setName

public void setName(java.lang.String name)
Get the value of the 'name' attribute.


getValue

public java.lang.String getValue()
Get the value of the 'value' attribute.


setValue

public void setValue(java.lang.String value)
Set the value of the 'value' attribute.


getDisabled

public java.lang.String getDisabled()
Get the value of the 'disabled' attribute.


setDisabled

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


writeTagContent

protected int writeTagContent(TagWriter tagWriter)
                       throws JspException
Description copied from class: AbstractFormTag
Subclasses should implement this method to perform tag content rendering.

Specified by:
writeTagContent in class AbstractFormTag
Returns:
valid tag render instruction as per javax.servlet.jsp.tagext.Tag#doStartTag().
Throws:
JspException

isDisabled

protected boolean isDisabled()
                      throws JspException
Is the current HTML tag disabled?

Throws:
JspException

writeValue

protected void writeValue(TagWriter tagWriter)
                   throws JspException
Writes the 'value' attribute to the supplied TagWriter. Subclasses may choose to override this implementation to control exactly when the value is written.

Throws:
JspException

getDefaultValue

protected java.lang.String getDefaultValue()
Return the default value.

Returns:
The default value if none supplied.

getType

protected java.lang.String getType()
Get the value of the 'type' attribute. Subclasses can override this to change the type of 'input' element rendered. Default value is 'submit'.


doEndTag

public int doEndTag()
             throws JspException
Closes the 'button' block tag.

Throws:
JspException