tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Pfeiffer <>
Subject How to end a JSP
Date Wed, 15 May 2002 18:11:11 GMT
If you have a try/catch block in a jsp and you catch an error that is know to cause the page
to function, how can you gracefully skip the rest of the jsp page and print an error message.
example, in the below code pictureBrowserBean.parseAlbums(); is going to throw a null pointer
exception.  I want the catch block to print an error message and quit running the jsp.  How
do I
do this?

<%@page contentType="text/html"%>
<head><title>JSP Page</title></head>

<%@ page import="*" %>
<%@ page import="java.util.*" %>

<jsp:useBean id="pictureBrowserBean" scope="session" class="mada.trips.PictureBrowserBean"

try {
catch (NullPointerException e) {


Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message