I'm going to go down the path of... why would you want to do this? Think of the response as an output file. Why would you want to read a file you were in the middle of writing? You could store this information elsewhere while you were writing the file for use later since its likely to be better managed in memory as a set of complex objects than a single stream.
Response header is somthing that is read by the browser (Considering browser as your request maker).If you want to see the headers , then try telenting into the http server and see what the server sends as response.After the frist line of the response and before the body , all are http headers.
There is a big story.. Im caching error code by using <error-page> <error-code>500</error-code> <location>/Message.jsp</location> </error-page> <error-page> <error-code>400</error-code> <location>/Message.jsp</location> </error-page> .. so on Now when ever it 500 error comes it will go to Message.jsp, but I neet to log the error code(which is the part of response header) what actually error code that web-app got.And Message.jsp will do loging part..
I can do this by having different pages like Message500.jsp Message400.jsp..
I suppose, if you really really really want to log response codes that way you could implement a Filter that substitutes your own HttpServletResponseWrapper custom class with one custom method setStatus(sc) that looks at the code before passing it to the enclosed HttpServletResponse.
Joined: Jan 11, 2006
Maybe I am still misunderstanding the question. javax.servlet.error.status_code: <error code> is the value that the server sends to the client. The container is required to set this value.
Remember you are forwarded to this jsp during the error. The attribute does not originate from the client.
The example on page 4 shows you how do what you want, which is what Rashid was describing. It does seem funny that the error codes are put in the request. [ October 19, 2006: Message edited by: sven studde ]