We wrote a site-monitoring tool that performs HTTP GETs and POSTs and
records the activity on the site. It uses the HTTP resultcode as a key
to track pages that are not working properly.
We have coded our system to catch errors and use 'callPage()' . We pass
the control to a second JSP page (errorPage.jsp). In this page, we
create a user-friendly page and help the user see what went wrong. All
this works. If we add into this page <% response.sendError(404); %>,
then this page is "enhanced" to include a bunch of stack trace work
(nice for debugging, but not what I want my customers to see) and then
my HTML is sent.
Apparently, the page is sent via an IBM object. The back-trace shows
the path as:
com.ibm.servlet.engine.webapp.WebAppErrorReport: [JSP 1.0 Processor]
reported an error
at
javax.servlet.ServletException.<init>(ServletException.java:49)
at
com.ibm.websphere.servlet.error.ServletErrorReport.<init>(ServletErrorReport.java:31)
at
com.ibm.servlet.engine.webapp.WebAppErrorReport.<init>(WebAppErrorReport.java:19)
at
com.ibm.servlet.engine.webapp.WebAppDispatcherResponse.sendError(WebAppDispatcherContext.java:268)
at
com.ibm.servlet.engine.webapp.WebAppDispatcherResponse.sendError(WebAppDispatcherContext.java:247)
at
C_0003a.WebSphere.AppServer.hosts.d_00025fault_0005fhost.Reporter_0002dStaging.web.errorPage_jsp_5._jspService(errorPage_jsp_5.java:82)
Does anyone know how to stop this "helpful assist" mode?
Thanks,
Charlie
--
Charles H. Woloszynski
Chief Technology Officer
ClearMetrix
10 Wilmot St, Suite 310
Morristown, NJ 07960
973.292.9882 office
973.670.3058 cell
240.371.3256 fax
c...@clearmetrix.com
Your error.jsp :
<html><head><body>
<%@ page isErrorPage="true" %>
<%@ page import="java.util.*, java.io.*" %>
<title>Error Page</title></head>
<p>The following error has occurred: <strong><%=exception%></strong>
</body></html>
Other jsp:
<html><head>
<% page errorPage="error.jsp" %>
<title>Other JSP </title>
<body>
:
</body></html>
Does anyone know how to set the error code for an error page? I know if I use sendError(code), the servlet code will also send additional
HTML (which is what I am trying to avoid.
TIA,
Charlie