JSP CUSTOM TAG LIBRARIES


Handling errors
If the debug attribute of a tag is set to true and the onfailure attribute is set to exception, any resulting error messages are written to the JSP container's STDOUT and STDERROR log files. Errors generated by a tag that has an onfailure attribute set to inline display the error message in bold text on the resulting page once it is processed by the browser.

The JSP tags can throw the following exception class:


This exception is thrown if a tag or parameter is used in an unsupported context and its onfailure attribute is set to exception.

This section defines the following:


The DominoTagException class

The DominoTagException contains an id and text attribute. You can retrieve exception objects using the following methods:

MethodRetrieves
getMessage()Run-time error messages triggered in tag processing.
getNotesException()Associated exception thrown by a Java back-end class, if applicable.
getException()Other kinds of associated exceptions, if applicable (IOExceptions, for example).

DominoTagException Interface

You can use the following Domino Tag Error interface to retrieve exception objects:

public class DominoTagException extends JspException {


}

DominoTagException error messages

The following table lists the different error messages generated by the id attribute of the DominoTagException class:

Id valueIndicates
INVALID_CONTEXTStructural error. You may have:
-used the specified tag outside its required context
-specified conflicting attribute values
This error is thrown at translation time.
VIEW_NOT_FOUNDRuntime error. Specifies that the named view was not found in the database.
DOMINO_ERRORCatch all for any NotesExceptions thrown that do not have a value-added context. You can retrieve the Exception object using the getNotesException() method.
IO_ERRORIndicates that an IOException occurred while writing output to the page. You can retrieve the IOException object using the getException() method.
JAVA_ERRORCatch all for any Java exceptions thrown. You can retrieve the Exception object using the getException() method.
DB_NOT_FOUNDRuntime error. Specifies that the named database could not be found.
INVALID_FORMATIndicates that the format string passed to the format attribute is invalid.
INVALID_STATEIndicates that you have lost the session state.
ITEM_NOT_FOUNDIndicates that the named item could not be found in the view.
INVALID_ATTRIBUTEIndicates that an attribute value is invalid.
AGENT_NOT_FOUNDSpecifies that the named agent could not be found.

Validation errors

Validation errors are collected and displayed by the validatesummary tag. The validatesummary tag loops through the page collecting the error messages generated when validation executed by any of the following validation tags fails:

Validation tag nameChecks if the user input consists of:
validatecca valid credit card number
validatedatea valid date or datetime value (You can set minimum and maximum date requirements.)
validatelengththe specified character length (You can set minimum and maximum length requirements.)
validatepatternthe specified pattern of data types
validaterangethe specified range
validaterequiredan entry (No datatype checking is done with this tag.)
validatewitha value that matches a specified constant value or another field input value according to the specified comparison operator

See Also