Class TransactionTagSupport
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport
-
- All Implemented Interfaces:
java.io.Serializable,IterationTag,JspTag,Tag,TryCatchFinally
- Direct Known Subclasses:
TransactionTag
public abstract class TransactionTagSupport extends TagSupport implements TryCatchFinally
Tag handler for <Transaction> in JSTL.
- See Also:
- Serialized Form
-
-
Field Summary
-
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 TransactionTagSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoCatch(java.lang.Throwable t)Rollbacks the transaction and rethrows the Throwable.intdoEndTag()Commits the transaction.voiddoFinally()Restores theConnectionto its initial state and closes it.intdoStartTag()Prepares for execution by setting the initial state, such as getting theConnectionand preparing it for the transaction.java.sql.ConnectiongetSharedConnection()Called by nested parameter elements to get a reference to the Connection.voidrelease()Release state.voidsetIsolation(java.lang.String iso)Setter method for the transaction isolation level.-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
-
-
-
Method Detail
-
doStartTag
public int doStartTag() throws JspExceptionPrepares for execution by setting the initial state, such as getting theConnectionand preparing it for the transaction.- Specified by:
doStartTagin interfaceTag- Overrides:
doStartTagin classTagSupport- Returns:
- SKIP_BODY
- Throws:
JspException- if an error occurs while processing this tag- See Also:
Tag.doStartTag()
-
doEndTag
public int doEndTag() throws JspExceptionCommits the transaction.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Returns:
- EVAL_PAGE
- Throws:
JspException- if an error occurs while processing this tag- See Also:
Tag.doEndTag()
-
doCatch
public void doCatch(java.lang.Throwable t) throws java.lang.ThrowableRollbacks the transaction and 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()
Restores theConnectionto its initial state and closes it.- Specified by:
doFinallyin interfaceTryCatchFinally
-
release
public void release()
Description copied from class:TagSupportRelease state.- Specified by:
releasein interfaceTag- Overrides:
releasein classTagSupport- See Also:
Tag.release()
-
setIsolation
public void setIsolation(java.lang.String iso) throws JspTagExceptionSetter method for the transaction isolation level.- Throws:
JspTagException
-
getSharedConnection
public java.sql.Connection getSharedConnection()
Called by nested parameter elements to get a reference to the Connection.
-
-