Re: wrong status code in HTTP Header

On Fri, 7 Dec 2001, Stefanie Wiemann wrote:

>
> Hi,
>
> I wrote a servlet which handles HTTP requests sent by an SAP server.
> After processing the data an answer with the correct HTTP status code
> must be returned (e.g. 201 if a document has been created or 404 if a
> document could not be found).
>
> I use the setStatus(int status) method of the
> javax.servlet.http.HttpServletResponse class to set the HTTP status
> which shall be returned to the client. This works fine with Tomcat and
> JRun.
> But with Jigsaw I always get 200 (which is the default, I think). The
> other parts of the servlet execute fine, e.g. documents are created as
> expected. Only the return code is not set correctly.
>
> Am I missing something?

When you get the stream to write on it, Jigsaw will start writing the
reply. So to be able to change the response code or any HTTP header, you
have to do it before actually sending bytes on the wire.
Regards,

-- 
Yves Lafon - W3C
"Baroula que barouleras, au tiéu toujou t'entourneras."

Received on Tuesday, 22 January 2002 10:30:24 UTC