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, 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Sets the specified variable to the provided value in the specified scope.
    Gets the scope this is accessible in.
    Gets the value to be assigned to the variable.
    Gets the variable name.
    void
    Sets the scope this can be accessed from.
    void
    Sets the value to be stored in the variable.
    void
    setVar(String variable)
    Sets 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SetTag

      public SetTag()
  • Method Details

    • getVar

      public String getVar()
      Gets the variable name.
      Returns:
      The name.
    • setVar

      public void setVar(String variable)
      Sets the variable name to store this with.
      Parameters:
      variable - The name.
    • getScope

      public String getScope()
      Gets the scope this is accessible in.
      Returns:
      The scope.
    • setScope

      public void setScope(String scope)
      Sets the scope this can be accessed from.
      Parameters:
      scope - The scope.
    • getValue

      public Object getValue()
      Gets the value to be assigned to the variable.
      Returns:
      The value
    • setValue

      public void setValue(Object value)
      Sets the value to be stored in the variable.
      Parameters:
      value - The value to store
    • doStartTag

      public int doStartTag() throws jakarta.servlet.jsp.JspException
      Sets the specified variable to the provided value in the specified scope.
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.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