Using try/catch Blocks
You can catch exceptions within specific parts of a JSP by using try/catch blocks within scriptlets. This is similar to handling exceptions using unit and failure tags, but allows you to more programmatically deal with exceptions. For example:
<%
try {
%>
<!-- webject or task invocations -->
<%
// catch statement appropriate given the contents of this block
} catch ( AdapterException ae ) {
//handle the adapter exception
} catch ( IDPartialResultsException partial ) {
// extract and display the partial results
}
// etc.
%>