Package net.sf.basedb.clients.web.taglib
Class ExceptionCatcher
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
net.sf.basedb.clients.web.taglib.ExceptionCatcher
- All Implemented Interfaces:
Serializable
,BodyTag
,IterationTag
,JspTag
,Tag
,TryCatchFinally
public class ExceptionCatcher extends BodyTagSupport implements TryCatchFinally
This tag is a wrapper that catches any errors in it's
body and outputs the error message.
Example:
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> <base:catch"> Here is some code that may throw an exception... </base:catch>
Syntax:
<base:catch clazz=... >
Attribute | Default value | Required | Description |
clazz | inlineerror | no | If an exception is thrown the error message will be displayed inside a <div> with class set to this value. |
- Version:
- 2.9.1
- Author:
- Nicklas
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private String
clazz
private static long
serialVersionUID
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
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 ExceptionCatcher()
-
Method Summary
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, doStartTag, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
clazz
-
-
Constructor Details
-
ExceptionCatcher
public ExceptionCatcher()
-
-
Method Details
-
setClazz
-
getClazz
-
doEndTag
- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classBodyTagSupport
- Throws:
JspException
-
doCatch
- Specified by:
doCatch
in interfaceTryCatchFinally
- Throws:
Throwable
-
doFinally
public void doFinally()- Specified by:
doFinally
in interfaceTryCatchFinally
-