You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ka...@mn.man.de on 2000/11/10 10:48:09 UTC

I want to use an JSP-Error-page to catch the Exception from an XML-Page

I use Cocoon 1.8 ( XML, XSP and XSL)  to generate dynamic HTML-Pages.
Now I want to catch the Exception, wich happen in the XSP-Logic. I want to
send this Exception with an email. But I don't know how can I get the
Exception.

Can I do it with an JSP-Page?

The following have I add to the web-xml-File:

<error-page>
      <error-code>500</error-code>
      <location>/test.jsp</location>
</error-page>

Thats the test.jsp-File:

<%@ page info="Exception-Page" isErrorPage="true" %>
<html>
<head><title>Exception-Page</title></head>
<body>
Fehler: <%= exception.toString() %>
</body>
</html>

If the test.jsp-File call from the server, following exception happen:

javax.servlet.ServletException
      at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)

      at _0002ftest_0002ejsptest_jsp_7._jspService
(_0002ftest_0002ejsptest_jsp_7.java:74)
      at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)

      at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
      at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
      at
org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:163)

      at
org.apache.tomcat.core.ContextManager.handleError(ContextManager.java,
Compiled Code)
      at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:164)

      at org.apache.cocoon.Cocoon.service(Cocoon.java:178)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
      at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
      at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)

      at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)

      at java.lang.Thread.run(Thread.java:479)

I don't know, whether or not I can catch the Exception with an JSP-Page.

Are there any other posibilities?
Thank you in advance!

Katrin Seiffert