Jim Conning wrote:

> I want to send an HTTP header from a JSP page.  I call
> response.setHeader() in the JSP page, near the top of the page, and it
> seems to work but the header is not received by the client.  I suspect
> the header is not being sent because the JSP servlet has already opened
> its output stream.  Does anybody know how to do this?  I am using JRun
> 2.33.
>

That's the correct call, but you need to ensure that the output stream has not yet
been "committed".  What that really means is that you want to make sure you have
declared a buffer large enough to hold all of the output above this statement in
the page.  Once the output buffer has been flushed the first time, all of the HTTP
headers have already been sent (they go first), so any later attempt to set a
header will be ignored.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to