Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Possible bug in 9.4 HttpServletResponse redirect?


On Thu, Jan 5, 2017 at 9:52 PM, Silvio Bierman
<sbierman@xxxxxxxxxxxxxxxxxx> wrote:
> Hello Simone,
> Yes, the sendRedirect was what I put in for the 302 case when it was not
> working. That did help for the redirects.
> But now I have fixed the code the way you told me to. That works (duh)
> although I now have to get the outputstream and close it to commit the
> response for things to work, even if no response body is present.
> Thanks for setting me straight.

Sure. Remember to first set the status code, then the response
headers, then the response content.
This order is important otherwise long headers or big content may
commit the response _before_ you can set the status.

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.

Back to the top