Class ButtonTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.springframework.web.servlet.tags.RequestContextAwareTag
org.springframework.web.servlet.tags.HtmlEscapingAwareTag
org.springframework.web.servlet.tags.form.AbstractFormTag
org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
org.springframework.web.servlet.tags.form.ButtonTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.DynamicAttributes, jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, jakarta.servlet.jsp.tagext.TryCatchFinally, Serializable, EditorAwareTag
The
<button> tag renders a form field label in an HTML 'button' tag.
It is provided for completeness if the application relies on a
RequestDataValueProcessor.
Attribute Summary
| Attribute | Required? | Runtime Expression? | Description |
|---|---|---|---|
disabled |
false |
true |
HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element. |
id |
false |
true |
HTML Standard Attribute |
name |
false |
true |
The name attribute for the HTML button tag |
value |
false |
true |
The name attribute for the HTML button tag |
- Since:
- 3.1
- Author:
- Rossen Stoyanchev
- See Also:
-
Field Summary
FieldsFields inherited from class 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_ATTRIBUTEFields inherited from class AbstractDataBoundFormElementTag
NESTED_PATH_VARIABLE_NAMEFields inherited from class RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTEFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
pageContextFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()Closes the 'button' block tag.protected StringReturn the default value.getName()Set the value of the 'name' attribute.protected StringgetType()Get the value of the 'type' attribute.getValue()Get the value of the 'value' attribute.booleanGet the value of the 'disabled' attribute.voidsetDisabled(boolean disabled) Set the value of the 'disabled' attribute.voidGet the value of the 'name' attribute.voidSet the value of the 'value' attribute.protected intwriteTagContent(TagWriter tagWriter) Subclasses should implement this method to perform tag content rendering.protected voidwriteValue(TagWriter tagWriter) Writes the 'value' attribute to the suppliedTagWriter.Methods inherited from class 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, writeOptionalAttributesMethods inherited from class AbstractDataBoundFormElementTag
autogenerateId, convertToDisplayString, doFinally, getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, processFieldValue, resolveId, setId, setPathMethods inherited from class AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttributeMethods inherited from class HtmlEscapingAwareTag
htmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscapeMethods inherited from class RequestContextAwareTag
doCatch, doStartTag, getRequestContextMethods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
-
Field Details
-
DISABLED_ATTRIBUTE
-
-
Constructor Details
-
ButtonTag
public ButtonTag()
-
-
Method Details
-
setName
Get the value of the 'name' attribute. -
getName
Set the value of the 'name' attribute.- Overrides:
getNamein classAbstractDataBoundFormElementTag- Returns:
- the value for the HTML '
name' attribute
-
setValue
-
getValue
-
setDisabled
public void setDisabled(boolean disabled) Set the value of the 'disabled' attribute. -
isDisabled
public boolean isDisabled()Get the value of the 'disabled' attribute. -
writeTagContent
Description copied from class:AbstractFormTagSubclasses should implement this method to perform tag content rendering.- Specified by:
writeTagContentin classAbstractFormTag- Returns:
- valid tag render instruction as per
Tag.doStartTag(). - Throws:
jakarta.servlet.jsp.JspException
-
writeValue
-
getDefaultValue
Return the default value.- Returns:
- the default value if none supplied
-
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 jakarta.servlet.jsp.JspExceptionCloses the 'button' block tag.- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.TagSupport- Throws:
jakarta.servlet.jsp.JspException
-