Hi, everyone!
Normal HTTP response status code is like this,
--------
HTTP/1.1 200 OK
--------
I want to use JSP to modify the status code like this,
--------
HTTP/1.1 666 OK
--------
How to do the job?
Thanks in advance,
George
Printable View
Hi, everyone!
Normal HTTP response status code is like this,
--------
HTTP/1.1 200 OK
--------
I want to use JSP to modify the status code like this,
--------
HTTP/1.1 666 OK
--------
How to do the job?
Thanks in advance,
George
Use HttpServletResponse.sendError(...).
Debugging is more difficult than coding. If you are as clever as you can be when coding, how can you ever hope to debug the code?
Thanks, dlorde pal!
I have tried your method, it really works, but
still do not serve my purpose entirely.
I want to modify the HTTP response code
--------
HTTP/1.1 200 OK
--------
to
--------
HTTP/1.1 666 hehe
--------
I use sendError(666, "hehe"),
but "hehe" displays in the body and not in the header.
What I want to do is to send error code (666) and error
message ("hehe") through the first line of HTTP response
header.
How to do that job?
Thanks in advance,
George
I don't know, George, it's not something I've had to do. Why not try all the likely looking HttpServletResponse 'header' methods? I don't know any other way to set response header data.
Sometimes trial and error is the best way...
The key to personal success is initiative...
Thanks! Let me try!
BTW: If you have got the answer, please notify me!
:-)
Quote:
Originally posted by dlorde
I don't know, George, it's not something I've had to do. Why not try all the likely looking HttpServletResponse 'header' methods? I don't know any other way to set response header data.
Sometimes trial and error is the best way...
The key to personal success is initiative...