Class AbstractHtmlElementBodyTag
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.AbstractHtmlElementBodyTag
- All Implemented Interfaces:
BodyTag,DynamicAttributes,IterationTag,JspTag,Tag,TryCatchFinally,Serializable,EditorAwareTag
Convenient super class for many html tags that render content using the databinding
features of the
AbstractHtmlElementTag. The only thing
sub-tags need to do is override renderDefaultContent(TagWriter).- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
- See Also:
-
Field Summary
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_ATTRIBUTEFields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
NESTED_PATH_VARIABLE_NAMEFields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTEFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
pageContextFields inherited from interface jakarta.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields 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()Ifrendering, flush any bufferedBodyContentor, if noBodyContentis supplied,render the default content.voidClean up any attributes and stored resources.voidprotected voidCalled duringwriteTagContent(org.springframework.web.servlet.tags.form.TagWriter)allowing subclasses to add any attributes to thePageContextas needed.protected voidflushBufferedBodyContent(BodyContent bodyContent) The user customised the output of the error messages - flush the buffered content into the mainJspWriter.protected voidCalled at the start ofwriteTagContent(org.springframework.web.servlet.tags.form.TagWriter)allowing subclasses to perform any precondition checks or setup tasks that might be necessary.protected voidCalled bydoFinally()allowing subclasses to remove any attributes from thePageContextas needed.protected abstract voidrenderDefaultContent(TagWriter tagWriter) protected voidrenderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) Render the tag contents based on the suppliedBodyContent.voidsetBodyContent(BodyContent bodyContent) protected booleanShould rendering of this tag proceed at all.protected intwriteTagContent(TagWriter tagWriter) Subclasses should implement this method to perform tag content rendering.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, writeOptionalAttributesMethods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
autogenerateId, convertToDisplayString, getBindStatus, getBoundValue, getEditor, getId, getName, getNestedPath, getPath, getPropertyEditor, getPropertyPath, processFieldValue, resolveId, setId, setPathMethods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttributeMethods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
htmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscapeMethods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContextMethods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.jsp.tagext.IterationTag
doAfterBodyMethods inherited from interface jakarta.servlet.jsp.tagext.Tag
doStartTag, getParent, release, setPageContext, setParent
-
Constructor Details
-
AbstractHtmlElementBodyTag
public AbstractHtmlElementBodyTag()
-
-
Method Details
-
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:
JspException
-
doEndTag
Ifrendering, flush any bufferedBodyContentor, if noBodyContentis supplied,render the default content.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Returns:
- a
Tag.EVAL_PAGEresult - Throws:
JspException
-
renderFromBodyContent
protected void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) throws JspException Render the tag contents based on the suppliedBodyContent.The default implementation simply
flushestheBodyContentdirectly to the output. Subclasses may choose to override this to add additional content to the output.- Throws:
JspException
-
doFinally
public void doFinally()Clean up any attributes and stored resources.- Specified by:
doFinallyin interfaceTryCatchFinally- Overrides:
doFinallyin classAbstractDataBoundFormElementTag
-
onWriteTagContent
protected void onWriteTagContent()Called at the start ofwriteTagContent(org.springframework.web.servlet.tags.form.TagWriter)allowing subclasses to perform any precondition checks or setup tasks that might be necessary. -
shouldRender
Should rendering of this tag proceed at all. Returns 'true' by default causing rendering to occur always, Subclasses can override this if they provide conditional rendering.- Throws:
JspException
-
exposeAttributes
Called duringwriteTagContent(org.springframework.web.servlet.tags.form.TagWriter)allowing subclasses to add any attributes to thePageContextas needed.- Throws:
JspException
-
removeAttributes
protected void removeAttributes()Called bydoFinally()allowing subclasses to remove any attributes from thePageContextas needed. -
flushBufferedBodyContent
The user customised the output of the error messages - flush the buffered content into the mainJspWriter.- Throws:
JspException
-
renderDefaultContent
- Throws:
JspException
-
doInitBody
- Specified by:
doInitBodyin interfaceBodyTag- Throws:
JspException
-
setBodyContent
- Specified by:
setBodyContentin interfaceBodyTag
-