Hi all,
I've got the following problem: I've got tomcat 3.2 running. In my web.xml I
set the error-page like this:
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>fehler.htm</location>
</error-page>
My fehler.htm is located in the default-root directory (the same directory
where WEB-INF is located).
In my Servlet I throw the ServletException:
public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>TestServlet</title></head>");
out.println("<body>");
out.println("<p>Das Servlet hat ein GET empfangen. Das ist die
Antwort.</p>");
out.println("</body></html>");
throw new javax.servlet.ServletException();
}
But when I start the servlet the standard error page is diplayed:
Das Servlet hat ein GET empfangen. Das ist die Antwort.
Error: 500
Location: /onlinestore/testservlet
Internal Servlet Error:
javax.servlet.ServletException
at onlinestore.TestServlet.doGet(TestServlet.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Why doesn't tomcat show the error-page fehler.htm? What am I doing wrong?
Pls help.
Here is my complete deployment descriptor web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>testservlet</servlet-name>
<servlet-class>onlinestore.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testservlet</servlet-name>
<url-pattern>/testservlet</url-pattern>
</servlet-mapping>
<error-page>
<error-code>500</error-code>
<location>fehler.htm</location>
</error-page>
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>fehler.htm</location>
</error-page>
</web-app>
Thx in advance!
Christian
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html