tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: 404 Not found - howto
Date Fri, 16 Aug 2002 13:02:48 GMT
You can do it a number of ways, which have varying levels of elegance
and container-independence.  

Perhaps the simplest way is to say, in pseudo code:

if(wsName not found)

You can also try simply setting the response code to 404 and sending
nothing else, and see how the browser handles it.

And maybe a nicer approach, though more work, is to define your own
error page (see the servlet spec), let's say my404error.jsp.  If ws=name
is not found, do a response.sendRedirect() to my404error.jsp.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Rum Pel []
>Sent: Friday, August 16, 2002 5:06 AM
>Subject: 404 Not found - howto
>Can a servlet produce a "404 Page Not found" error? It seems to me
>that it is the webserver/appserver that should do this, but I want
>it in the context of outputting static content via a servlet:
>should give a 404 error in case ws=name is not found.
>Join the world's largest e-mail service with MSN Hotmail.
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>For additional commands, e-mail: <mailto:tomcat-user-

View raw message