|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
com.taggercat.tags.AbstractExpEvalTag
com.taggercat.tags.ExceptionTag
public class ExceptionTag
This tag returns the current exception message, and optionally the associated stack trace.
If there is no exception on the page, then the tag has no output. If the exception has no message, then the message defaults to: "No Exception message is available."| Exception Tag Attribute Summary | |||||
| Name | Required | Request-time | Default | Type | Description |
| label | false | true | null | String |
The label to prefix the exception message. |
| lineSeparator | false | true | null | String |
The characters to use for line breaks. This is useful if creating a JavaScript variable. |
| stackTrace | false | true | false | boolean |
Set true to include the stack trace. This can be an expression. |
| escapeHTML | false | true | false | boolean |
Set true to escape HTML in the message, for example <, >, " |
| escapeQuotes | false | true | false | Boolean |
Set true to escape double quotes " with a preceding slash \". This is useful if creating a JavaScript variable. |
| preformat | false | true | true | Boolean |
Set true to wrap the message and the stack trace in <pre> and </pre> tags. |
<tc:exception label='An error has occured..' escapeHTML='true' stackTrace='true' preformat='true' />To include the exception in a JavaScript alert() method, you can use code such as:
<script language="JavaScript" >
function showErrors()
{
var errorMessage = "<tc:exception preformat='false' lineSeparator='\\n' escapeQuotes='true' />";
if( errorMessage != "" ) { alert( errorMessage ); }
}
</script>
And then in page's HTML body tag, call the showErrors() function using code such as:<body onLoad="enableControls(), showErrors()" >

| 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 | |
|---|---|
ExceptionTag()
Creates a new Exception tag. |
|
| Method Summary | |
|---|---|
int |
doEndTag()
Resets the tags internal state. |
int |
doStartTag()
Sends the value of the data field to the page. |
void |
setEscapeHTML(boolean escapeHTML)
Sets the property to escape any HTML characters in the exception message with the appropriate HTML escape sequence. |
void |
setEscapeQuotes(boolean escapeQuotes)
Sets the property to escape any double quotes in the exception message with a preceding back slash \ character. |
void |
setLabel(java.lang.String label)
Sets the label to print before the exception message. |
void |
setLineSeparator(java.lang.String lineSeparator)
Sets the lineSeparator to use between lines of the exception message. |
void |
setpreformat(boolean preformat)
Sets the property to preformat the stacktrace using <PRE> and </PRE> tags. |
void |
setStackTrace(boolean stackTrace)
Set the property to include the stack trace with the exception. |
void |
setStackTrace(java.lang.String stackTrace)
Set the property to include the stack trace with the exception. |
| Methods inherited from class com.taggercat.tags.AbstractExpEvalTag |
|---|
getModel, resolveProperty, setScope, setValue, setVar |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExceptionTag()
| Method Detail |
|---|
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class AbstractExpEvalTagjavax.servlet.jsp.JspException
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class AbstractExpEvalTagjavax.servlet.jsp.JspException
public void setLineSeparator(java.lang.String lineSeparator)
lineSeparator - the lineSeparatorpublic void setStackTrace(java.lang.String stackTrace)
stackTrace - set true to include the stacktracepublic void setStackTrace(boolean stackTrace)
stackTrace - set true to include the stacktracepublic void setEscapeQuotes(boolean escapeQuotes)
escapeQuotes - set true to escape double quotespublic void setEscapeHTML(boolean escapeHTML)
escapeHTML - set true to escape double quotesText.escapeHTML(String text)public void setLabel(java.lang.String label)
label - the labelpublic void setpreformat(boolean preformat)
preformat - set true to preformat the message and stack trace
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||