tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manri Offermann" <ma...@globalscale.net>
Subject [TC4] error-page exception is null
Date Fri, 28 Sep 2001 15:47:48 GMT
Hi,

I am trying to display a custom error page. Everything works fine, when
throwing errors from a JSP page, but when I throw an error from a Servlet,
the exception I receive on the error page is null. Why? The same code worked
on Tomcat 3.2

Test Servlet:
=======================================================
import java.io.IOException;

import javax.servlet.http.*;
import javax.servlet.*;

public class Test extends HttpServlet {
 public void service(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
  throw new ServletException("Test");
 }
}

web.xml:
=======================================================
 <error-page>
  <exception-type>javax.servlet.ServletException</exception-type>
  <location>/err.jsp</location>
 </error-page>
 <error-page>
  <exception-type>java.lang.Exception</exception-type>
  <location>/err.jsp</location>
 </error-page>


err.jsp:
=======================================================
<%@ page isErrorPage="true" %>

<%=exception%>   <---- is null from a servlet, and ok if from a JSP



manri



Mime
View raw message