Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help! How can I set the result code to 404 and NOT have WAS inject a stack trace?

1 view
Skip to first unread message

Charlie Woloszynski

unread,
Oct 23, 2000, 3:00:00 AM10/23/00
to
Does anyone know how to send back an error page with a specific error
code in WAS?

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

Sung-Ik Son

unread,
Oct 23, 2000, 3:00:00 AM10/23/00
to
How about this ?

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>

Charlie Woloszynski

unread,
Oct 24, 2000, 3:00:00 AM10/24/00
to
I need something that will set the errorCode to 404. Does this do that? I suspect that it sends an error page, but I suspect that it does
not change the error code (there are many to choose from, so I think we'd have to specify it somewhere).

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

0 new messages