Class AbstractHtmlElementTag
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
- All Implemented Interfaces:
DynamicAttributes
,IterationTag
,JspTag
,Tag
,TryCatchFinally
,Serializable
,EditorAwareTag
- Direct Known Subclasses:
AbstractHtmlElementBodyTag
,AbstractHtmlInputElementTag
,ButtonTag
,FormTag
,HiddenInputTag
,LabelTag
,OptionsTag
public abstract class AbstractHtmlElementTag
extends AbstractDataBoundFormElementTag
implements DynamicAttributes
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, Rossen Stoyanchev
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
NESTED_PATH_VARIABLE_NAME
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport
pageContext
Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Get the value of the 'class
' attribute.protected String
The CSS class to use when the field bound to a particular tag has errors.protected String
Get the value of the 'style
' attribute.protected String
getDir()
Get the value of the 'dir
' attribute.Get the map of dynamic attributes.protected String
getLang()
Get the value of the 'lang
' attribute.protected String
Get the value of the 'onclick
' attribute.protected String
Get the value of the 'ondblclick
' attribute.protected String
Get the value of the 'onkeydown
' attribute.protected String
Get the value of the 'onkeypress
' attribute.protected String
Get the value of the 'onkeyup
' attribute.protected String
Get the value of the 'onmousedown
' attribute.protected String
Get the value of the 'onmousemove
' attribute.protected String
Get the value of the 'onmouseout
' attribute.protected String
Get the value of the 'onmouseover
' attribute.protected String
Get the value of the 'onmouseup
' attribute.protected String
Get the value of the 'tabindex
' attribute.protected String
getTitle()
Get the value of the 'title
' attribute.protected boolean
isValidDynamicAttribute
(String localName, Object value) Whether the given name-value pair is a valid dynamic attribute.protected String
Gets the appropriate CSS class to use based on the state of the currentBindStatus
object.void
setCssClass
(String cssClass) Set the value of the 'class
' attribute.void
setCssErrorClass
(String cssErrorClass) The CSS class to use when the field bound to a particular tag has errors.void
setCssStyle
(String cssStyle) Set the value of the 'style
' attribute.void
Set the value of the 'dir
' attribute.void
setDynamicAttribute
(String uri, String localName, Object value) void
Set the value of the 'lang
' attribute.void
setOnclick
(String onclick) Set the value of the 'onclick
' attribute.void
setOndblclick
(String ondblclick) Set the value of the 'ondblclick
' attribute.void
setOnkeydown
(String onkeydown) Set the value of the 'onkeydown
' attribute.void
setOnkeypress
(String onkeypress) Set the value of the 'onkeypress
' attribute.void
setOnkeyup
(String onkeyup) Set the value of the 'onkeyup
' attribute.void
setOnmousedown
(String onmousedown) Set the value of the 'onmousedown
' attribute.void
setOnmousemove
(String onmousemove) Set the value of the 'onmousemove
' attribute.void
setOnmouseout
(String onmouseout) Set the value of the 'onmouseout
' attribute.void
setOnmouseover
(String onmouseover) Set the value of the 'onmouseover
' attribute.void
setOnmouseup
(String onmouseup) Set the value of the 'onmouseup
' attribute.void
setTabindex
(String tabindex) Set the value of the 'tabindex
' attribute.void
Set the value of the 'title
' attribute.protected void
writeDefaultAttributes
(TagWriter tagWriter) Writes the default attributes configured via this base class to the suppliedTagWriter
.protected void
writeOptionalAttributes
(TagWriter tagWriter) Writes the optional attributes configured via this base class to the suppliedTagWriter
.Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, convertToDisplayString, doFinally, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, processFieldValue, resolveId, setId, setPath
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute, writeTagContent
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
htmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
-
Field Details
-
CLASS_ATTRIBUTE
- See Also:
-
STYLE_ATTRIBUTE
- See Also:
-
LANG_ATTRIBUTE
- See Also:
-
TITLE_ATTRIBUTE
- See Also:
-
DIR_ATTRIBUTE
- See Also:
-
TABINDEX_ATTRIBUTE
- See Also:
-
ONCLICK_ATTRIBUTE
- See Also:
-
ONDBLCLICK_ATTRIBUTE
- See Also:
-
ONMOUSEDOWN_ATTRIBUTE
- See Also:
-
ONMOUSEUP_ATTRIBUTE
- See Also:
-
ONMOUSEOVER_ATTRIBUTE
- See Also:
-
ONMOUSEMOVE_ATTRIBUTE
- See Also:
-
ONMOUSEOUT_ATTRIBUTE
- See Also:
-
ONKEYPRESS_ATTRIBUTE
- See Also:
-
ONKEYUP_ATTRIBUTE
- See Also:
-
ONKEYDOWN_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
AbstractHtmlElementTag
public AbstractHtmlElementTag()
-
-
Method Details
-
setCssClass
Set the value of the 'class
' attribute. May be a runtime expression. -
getCssClass
Get the value of the 'class
' attribute. May be a runtime expression. -
setCssErrorClass
The CSS class to use when the field bound to a particular tag has errors. May be a runtime expression. -
getCssErrorClass
The CSS class to use when the field bound to a particular tag has errors. May be a runtime expression. -
setCssStyle
Set the value of the 'style
' attribute. May be a runtime expression. -
getCssStyle
Get the value of the 'style
' attribute. May be a runtime expression. -
setLang
Set the value of the 'lang
' attribute. May be a runtime expression. -
getLang
Get the value of the 'lang
' attribute. May be a runtime expression. -
setTitle
Set the value of the 'title
' attribute. May be a runtime expression. -
getTitle
Get the value of the 'title
' attribute. May be a runtime expression. -
setDir
Set the value of the 'dir
' attribute. May be a runtime expression. -
getDir
Get the value of the 'dir
' attribute. May be a runtime expression. -
setTabindex
Set the value of the 'tabindex
' attribute. May be a runtime expression. -
getTabindex
Get the value of the 'tabindex
' attribute. May be a runtime expression. -
setOnclick
Set the value of the 'onclick
' attribute. May be a runtime expression. -
getOnclick
Get the value of the 'onclick
' attribute. May be a runtime expression. -
setOndblclick
Set the value of the 'ondblclick
' attribute. May be a runtime expression. -
getOndblclick
Get the value of the 'ondblclick
' attribute. May be a runtime expression. -
setOnmousedown
Set the value of the 'onmousedown
' attribute. May be a runtime expression. -
getOnmousedown
Get the value of the 'onmousedown
' attribute. May be a runtime expression. -
setOnmouseup
Set the value of the 'onmouseup
' attribute. May be a runtime expression. -
getOnmouseup
Get the value of the 'onmouseup
' attribute. May be a runtime expression. -
setOnmouseover
Set the value of the 'onmouseover
' attribute. May be a runtime expression. -
getOnmouseover
Get the value of the 'onmouseover
' attribute. May be a runtime expression. -
setOnmousemove
Set the value of the 'onmousemove
' attribute. May be a runtime expression. -
getOnmousemove
Get the value of the 'onmousemove
' attribute. May be a runtime expression. -
setOnmouseout
Set the value of the 'onmouseout
' attribute. May be a runtime expression. -
getOnmouseout
Get the value of the 'onmouseout
' attribute. May be a runtime expression. -
setOnkeypress
Set the value of the 'onkeypress
' attribute. May be a runtime expression. -
getOnkeypress
Get the value of the 'onkeypress
' attribute. May be a runtime expression. -
setOnkeyup
Set the value of the 'onkeyup
' attribute. May be a runtime expression. -
getOnkeyup
Get the value of the 'onkeyup
' attribute. May be a runtime expression. -
setOnkeydown
Set the value of the 'onkeydown
' attribute. May be a runtime expression. -
getOnkeydown
Get the value of the 'onkeydown
' attribute. May be a runtime expression. -
getDynamicAttributes
Get the map of dynamic attributes. -
setDynamicAttribute
- Specified by:
setDynamicAttribute
in interfaceDynamicAttributes
- Throws:
JspException
-
isValidDynamicAttribute
Whether the given name-value pair is a valid dynamic attribute. -
writeDefaultAttributes
Writes the default attributes configured via this base class to the suppliedTagWriter
. Subclasses should call this when they want the base attribute set to be written to the output.- Overrides:
writeDefaultAttributes
in classAbstractDataBoundFormElementTag
- Parameters:
tagWriter
- theTagWriter
to which any attributes are to be written- Throws:
JspException
-
writeOptionalAttributes
Writes the optional attributes configured via this base class to the suppliedTagWriter
. The set of optional attributes that will be rendered includes any non-standard dynamic attributes. Called bywriteDefaultAttributes(TagWriter)
.- Throws:
JspException
-
resolveCssClass
Gets the appropriate CSS class to use based on the state of the currentBindStatus
object.- Throws:
JspException
-