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=... >
Tag attributes 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doCatch(Throwable t)
int
doEndTag()
void
doFinally()
String
getClazz()
void
setClazz(String clazz)
-
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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
clazz
private String clazz
-
-
Method Detail
-
setClazz
public void setClazz(String clazz)
-
getClazz
public String getClazz()
-
doEndTag
public int doEndTag() throws JspException
- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classBodyTagSupport
- Throws:
JspException
-
doCatch
public void doCatch(Throwable t) throws Throwable
- Specified by:
doCatch
in interfaceTryCatchFinally
- Throws:
Throwable
-
doFinally
public void doFinally()
- Specified by:
doFinally
in interfaceTryCatchFinally
-
-