Hi,
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)
  response.sendRedirect(http://aURLOnMyServerThatIKnowIs404);

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 [mailto:[EMAIL PROTECTED]]
>Sent: Friday, August 16, 2002 5:06 AM
>To: [EMAIL PROTECTED]
>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:
>http://localhost:8080/webapp/wsdl?ws=name
>should give a 404 error in case ws=name is not found.
>
>thanks,
>--rp
>
>
>
>_________________________________________________________________
>Join the world's largest e-mail service with MSN Hotmail.
>http://www.hotmail.com
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:tomcat-user-
>[EMAIL PROTECTED]>

This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to