Class UpdateTagSupport
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
- org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport
-
- All Implemented Interfaces:
java.io.Serializable,SQLExecutionTag,BodyTag,IterationTag,JspTag,Tag,TryCatchFinally
- Direct Known Subclasses:
UpdateTag
public abstract class UpdateTagSupport extends BodyTagSupport implements TryCatchFinally, SQLExecutionTag
Tag handler for <Update> in JSTL.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
-
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
-
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
-
Constructor Summary
Constructors Constructor Description UpdateTagSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSQLParameter(java.lang.Object o)Called by nested parameter elements to add PreparedStatement parameter values.voiddoCatch(java.lang.Throwable t)Just rethrows the Throwable.intdoEndTag()Execute the SQL statement, set either through thesqlattribute or as the body, and save the result as a variable named by thevarattribute in the scope specified by thescopeattribute, as an object that implements the Result interface.voiddoFinally()Close theConnection, unless this action is used as part of a transaction.intdoStartTag()Prepares for execution by setting the initial state, such as getting theConnectionvoidsetScope(java.lang.String scopeName)Setter method for the scope of the variable to hold the result.voidsetVar(java.lang.String var)Setter method for the name of the variable to hold the result.-
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
-
-
-
Method Detail
-
setVar
public void setVar(java.lang.String var)
Setter method for the name of the variable to hold the result.
-
setScope
public void setScope(java.lang.String scopeName)
Setter method for the scope of the variable to hold the result.
-
doStartTag
public int doStartTag() throws JspExceptionPrepares for execution by setting the initial state, such as getting theConnection- Specified by:
doStartTagin interfaceTag- Overrides:
doStartTagin classBodyTagSupport- Returns:
- EVAL_BODY_BUFFERED
- Throws:
JspException- if an error occurred while processing this tag- See Also:
Tag.doStartTag()
-
doEndTag
public int doEndTag() throws JspExceptionExecute the SQL statement, set either through the
sqlattribute or as the body, and save the result as a variable named by thevarattribute in the scope specified by thescopeattribute, as an object that implements the Result interface.The connection used to execute the statement comes either from the
DataSourcespecified by thedataSourceattribute, provided by a parent action element, or is retrieved from a JSP scope attribute namedjavax.servlet.jsp.jstl.sql.dataSource.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classBodyTagSupport- Returns:
- EVAL_PAGE
- Throws:
JspException- if an error occurred while processing this tag- See Also:
Tag.doEndTag()
-
doCatch
public void doCatch(java.lang.Throwable t) throws java.lang.ThrowableJust rethrows the Throwable.- Specified by:
doCatchin interfaceTryCatchFinally- Parameters:
t- The throwable exception navigating through this tag.- Throws:
java.lang.Throwable- if the exception is to be rethrown further up the nest chain.
-
doFinally
public void doFinally()
Close theConnection, unless this action is used as part of a transaction.- Specified by:
doFinallyin interfaceTryCatchFinally
-
addSQLParameter
public void addSQLParameter(java.lang.Object o)
Called by nested parameter elements to add PreparedStatement parameter values.- Specified by:
addSQLParameterin interfaceSQLExecutionTag- Parameters:
o- thePreparedStatementparameter value
-
-