You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rum Pel <ru...@hotmail.com> on 2002/08/16 11:05:47 UTC

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: 404 Not found - howto

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 16 Aug 2002, Rum Pel wrote:

> Date: Fri, 16 Aug 2002 05:05:47 -0400
> From: Rum Pel <ru...@hotmail.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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.
>

  response.sendError(HttpServletResponse.SC_NOT_FOUND,
                    "your error message goes here");

> thanks,
> --rp
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>