Class UpdateTagSupport

  • All Implemented Interfaces:
    jakarta.servlet.jsp.jstl.sql.SQLExecutionTag, jakarta.servlet.jsp.tagext.BodyTag, jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, jakarta.servlet.jsp.tagext.TryCatchFinally, Serializable
    Direct Known Subclasses:
    UpdateTag, UpdateTag

    public abstract class UpdateTagSupport
    extends jakarta.servlet.jsp.tagext.BodyTagSupport
    implements jakarta.servlet.jsp.tagext.TryCatchFinally, jakarta.servlet.jsp.jstl.sql.SQLExecutionTag

    Tag handler for <Update> in JSTL.

    Author:
    Hans Bergsten, Justyna Horwat
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean dataSourceSpecified  
      protected Object rawDataSource  
      protected String sql  
      • Fields inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport

        bodyContent
      • Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

        id, pageContext
      • Fields inherited from interface jakarta.servlet.jsp.tagext.BodyTag

        EVAL_BODY_BUFFERED, EVAL_BODY_TAG
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSQLParameter​(Object o)
      Called by nested parameter elements to add PreparedStatement parameter values.
      void doCatch​(Throwable t)
      Just rethrows the Throwable.
      int doEndTag()
      Execute the SQL statement, set either through the sql attribute or as the body, and save the result as a variable named by the var attribute in the scope specified by the scope attribute, as an object that implements the Result interface.
      void doFinally()
      Close the Connection, unless this action is used as part of a transaction.
      int doStartTag()
      Prepares for execution by setting the initial state, such as getting the Connection
      void setScope​(String scopeName)
      Setter method for the scope of the variable to hold the result.
      void setVar​(String var)
      Setter method for the name of the variable to hold the result.
      • Methods inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport

        doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
      • Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

        findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
      • Methods inherited from interface jakarta.servlet.jsp.tagext.Tag

        getParent, setPageContext, setParent
    • Field Detail

      • rawDataSource

        protected Object rawDataSource
      • dataSourceSpecified

        protected boolean dataSourceSpecified
    • Constructor Detail

      • UpdateTagSupport

        public UpdateTagSupport()
    • Method Detail

      • setVar

        public void setVar​(String var)
        Setter method for the name of the variable to hold the result.
      • setScope

        public void setScope​(String scopeName)
        Setter method for the scope of the variable to hold the result.
      • doStartTag

        public int doStartTag()
                       throws jakarta.servlet.jsp.JspException
        Prepares for execution by setting the initial state, such as getting the Connection
        Specified by:
        doStartTag in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class jakarta.servlet.jsp.tagext.BodyTagSupport
        Throws:
        jakarta.servlet.jsp.JspException
      • doEndTag

        public int doEndTag()
                     throws jakarta.servlet.jsp.JspException

        Execute the SQL statement, set either through the sql attribute or as the body, and save the result as a variable named by the var attribute in the scope specified by the scope attribute, as an object that implements the Result interface.

        The connection used to execute the statement comes either from the DataSource specified by the dataSource attribute, provided by a parent action element, or is retrieved from a JSP scope attribute named jakarta.servlet.jsp.jstl.sql.dataSource.

        Specified by:
        doEndTag in interface jakarta.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class jakarta.servlet.jsp.tagext.BodyTagSupport
        Throws:
        jakarta.servlet.jsp.JspException
      • doCatch

        public void doCatch​(Throwable t)
                     throws Throwable
        Just rethrows the Throwable.
        Specified by:
        doCatch in interface jakarta.servlet.jsp.tagext.TryCatchFinally
        Throws:
        Throwable
      • doFinally

        public void doFinally()
        Close the Connection, unless this action is used as part of a transaction.
        Specified by:
        doFinally in interface jakarta.servlet.jsp.tagext.TryCatchFinally
      • addSQLParameter

        public void addSQLParameter​(Object o)
        Called by nested parameter elements to add PreparedStatement parameter values.
        Specified by:
        addSQLParameter in interface jakarta.servlet.jsp.jstl.sql.SQLExecutionTag