2.17.2: 2011-06-17

net.sf.basedb.clients.web.taglib
Class ExceptionCatcher

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by 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
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
ExceptionCatcher()
           
 
Method Summary
 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
Constructor Detail

ExceptionCatcher

public ExceptionCatcher()
Method Detail

setClazz

public void setClazz(String clazz)

getClazz

public String getClazz()

doEndTag

public int doEndTag()
             throws JspException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException

doCatch

public void doCatch(Throwable t)
             throws Throwable
Specified by:
doCatch in interface TryCatchFinally
Throws:
Throwable

doFinally

public void doFinally()
Specified by:
doFinally in interface TryCatchFinally

2.17.2: 2011-06-17