Class ValueTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
com.invirgance.convirgance.web.tag.ValueTag
- All Implemented Interfaces:
ValueTypeTag,jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag,Serializable
A custom JSP tag that sets a value on a parent tag implementing ValueTypeTag.
This tag is designed to be used within parent tags that implement the
ValueTypeTag interface, such as ArrayTag. It passes a value
to the parent tag, which can be provided either through its body content,
the value attribute, or from nested tags.- Author:
- jbanes
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, 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()Passes the value (or default value if null) to the parent ValueTypeTag.intEvaluates the tag body to potentially set the value.Gets the default value to use when no value is provided.jakarta.servlet.jsp.tagext.TaggetValue()Gets the value to be passed to the parent tag.voidrelease()voidsetDefault(Object defaultValue) Sets the default value to use when no value is provided.voidsetParent(jakarta.servlet.jsp.tagext.Tag parent) voidSets the value to be passed to the parent tag.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getValue, getValues, removeValue, setId, setPageContext, setValue
-
Constructor Details
-
ValueTag
public ValueTag()
-
-
Method Details
-
getValue
Gets the value to be passed to the parent tag.- Specified by:
getValuein interfaceValueTypeTag- Returns:
- The stored value
-
setValue
Sets the value to be passed to the parent tag.- Specified by:
setValuein interfaceValueTypeTag- Parameters:
value- The value to store
-
getDefault
Gets the default value to use when no value is provided.- Returns:
- The default value
-
setDefault
Sets the default value to use when no value is provided.- Parameters:
defaultValue- The default value
-
getParent
public jakarta.servlet.jsp.tagext.Tag getParent()- Specified by:
getParentin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
getParentin classjakarta.servlet.jsp.tagext.TagSupport
-
setParent
public void setParent(jakarta.servlet.jsp.tagext.Tag parent) - Specified by:
setParentin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
setParentin classjakarta.servlet.jsp.tagext.TagSupport
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionEvaluates the tag body to potentially set the value.- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.TagSupport- Returns:
- EVAL_BODY_INCLUDE to process the tag body
- Throws:
jakarta.servlet.jsp.JspException- If evaluation fails
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspExceptionPasses the value (or default value if null) to the parent ValueTypeTag.- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.TagSupport- Returns:
- EVAL_PAGE to continue processing the page
- Throws:
jakarta.servlet.jsp.JspException- If passing the value fails
-
release
public void release()- Specified by:
releasein interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
releasein classjakarta.servlet.jsp.tagext.TagSupport
-