Error taglib ver. 1.6

    Custom JSP tag. Provides a generic support for your error pages. Tag showError will print error message and an appropriate stack on your error page. So a typical error page for your application may looks so:
 


<%@ page isErrorPage="true" %>

<%@ taglib uri="taglib.tld" prefix="ex" %>

<ex:showError />

Tag dumpError lets you save error info as well as user specified data to some file. For example, in your web.xml file you may set the following definition for error page:
 


<error-page>
 <exception-type>java.lang.Exception</exception-type>
 <location>myErrorPage.jsp</location>
</error-page>

and myErrorPage.jsp will log error related data:
 



<%@ taglib uri="taglib.tld" prefix="ex" %>

<ex:dumpError file="c:/errors.txt" stack="true" headers="true" parameters="true"/>

Tags are:

showError

Prints error message and stack. Parameters are:

1) id Optional parameter. Describes a page scope variable for data (type is java.lang.String). Without this parameter tag just prints data.

dumpError

Prints error info to the given file. Parameters are:

1) file Optional parameter. Describes a file for your log. By default tag will use system log.
2) stack Optional parameter. Possible values are true or false. If this value is true than tag will print an error stack too. Default value is false.
3) headers Optional parameter. Possible values are true or false. If this value is true than tag will print headers from the failed request too. Default value is false.
4) parameters Optional parameter. Possible values are true or false. If this value is true than tag will print parameters from the failed request too. Default value is false.

for downloading:

Library: errortag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: