tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BugRat Mail System <>
Subject BugRat Report #102 has been filed.
Date Mon, 11 Sep 2000 23:41:45 GMT
Bug report #102 has just been filed.

You can view the report at the following URL:


REPORT #102 Details.

Project: Servlet API
Category: Bug Report
SubCategory: New Bug Report
Class: webbug
State: received
Priority: medium
Severity: serious
Confidence: public
   Release: Servlet API 1.2
   JVM Release: 1.3.3
   Operating System: Solaris
   OS Release: 8
   Platform: Sparc

sendRedirect clears HTTP headers

A call to HttpServletResponse.sendRedirect clears all HTTP headers before sending its redirect
response.  This makes it difficult to do something like add a cookie, and then redirect the

protected void doGet(HttpServletRequest request, HttpServletResponse response)
   Cookie cookie = new Cookie("my", "cookie");

The sendRedirect call clears the addCookie from the response headers.

I can imagine that this might not actually be a bug.  In my thinking and experience, the above
code is perfectly legal HTTP processing.  But perhaps there is a design consideration for
doing it this way.  I understand that with the current Servlet implementation, it is possible
to send a redirect after data has been written to the output stream.  I do believe though
that this feature should not supercede the flexibility of the sendRedirect command.

View raw message