If an uncaught exception occurs in a JSP file, Sun Java System Web Server generates an exception, usually a 404 or 500 error. To avoid this problem, set the errorPage attribute of the <%@ page%> tag.