tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Plail <pl...@web.de>
Subject Re: Tomcat overwrites error response body
Date Thu, 17 Nov 2005 11:22:58 GMT
Anurag Chakravarti <ac2491@cs.columbia.edu> writes:
> Tomcat sends back a default error HTML page, even when I don't want it
> to. I want my servlet to send its own error response body. I am doing
> the following in my servlet doPut method.
>
> java.io.PrintWriter pr = resp.getWriter();
> pr.println(e.getErrorCode().serialize());
> resp.sendError(e.getCode());
>
> This does not work. Tomcat sends me a HTML page which I don't want.
> What am I missing here.

Don't use sendError but setStatus. sendError does the complete error
page and you can only change its content via web.xml.

regards
Markus


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message