Class SetTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
com.invirgance.convirgance.web.tag.SetTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag,Serializable
public class SetTag
extends jakarta.servlet.jsp.tagext.TagSupport
A custom JSP tag that sets a variable in a specified scope.
This tag provides a convenient way to set variables in different scopes
(page, request, session, or application) from within a JSP page. It can be used
to store any object value under a specified variable name.
- 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 TypeMethodDescriptionintSets the specified variable to the provided value in the specified scope.getScope()Gets the scope this is accessible in.getValue()Gets the value to be assigned to the variable.getVar()Gets the variable name.voidSets the scope this can be accessed from.voidSets the value to be stored in the variable.voidSets the variable name to store this with.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
-
Constructor Details
-
SetTag
public SetTag()
-
-
Method Details
-
getVar
Gets the variable name.- Returns:
- The name.
-
setVar
Sets the variable name to store this with.- Parameters:
variable- The name.
-
getScope
Gets the scope this is accessible in.- Returns:
- The scope.
-
setScope
Sets the scope this can be accessed from.- Parameters:
scope- The scope.
-
getValue
Gets the value to be assigned to the variable.- Returns:
- The value
-
setValue
Sets the value to be stored in the variable.- Parameters:
value- The value to store
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionSets the specified variable to the provided value in the specified scope.- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.TagSupport- Returns:
- SKIP_BODY since this tag doesn't process its body
- Throws:
jakarta.servlet.jsp.JspException- If the variable cannot be set
-