A
Andy Fish
Hi,
I am trying to figure out how to return a servlet response with:
- status = 200
- reason phrase - something of my own making (i.e. not the string "OK")
- some content in the body
HttpServletResponse.setStatus(int, String) is deprecated because of
"ambiguous meaning of the message parameter". I'm not sure in what sense it
is ambiguous - I presume it corresponds to the reason phrase and in rfc2616
it says that the default reason phrases are just examples.
I can use sendError to specify a reason phrase which seems to work even for
SC_OK. However, I can't use sendError when including any content in the body
of the response.
so I can't see anything in the HTTP specification that says what I'm trying
to do is wrong, but there seems to be no way of doing it with a servlet.
Thanks in advance for any hints or comments
Andy
I am trying to figure out how to return a servlet response with:
- status = 200
- reason phrase - something of my own making (i.e. not the string "OK")
- some content in the body
HttpServletResponse.setStatus(int, String) is deprecated because of
"ambiguous meaning of the message parameter". I'm not sure in what sense it
is ambiguous - I presume it corresponds to the reason phrase and in rfc2616
it says that the default reason phrases are just examples.
I can use sendError to specify a reason phrase which seems to work even for
SC_OK. However, I can't use sendError when including any content in the body
of the response.
so I can't see anything in the HTTP specification that says what I'm trying
to do is wrong, but there seems to be no way of doing it with a servlet.
Thanks in advance for any hints or comments
Andy