see iam forwarding the response from the servlet to another jsp page.so that response object should hold the header "Arun" surely coz i have not thrown my reponse to the browser,I have forwarded it to the jsp.
Then why i get a null value.How it got missed
Joined: Aug 14, 2006
See we can set header only in response object. ie,response.setHeader("arun","prasath");
we canretrieve the header value only using request.getHeader("arun");
HTTP response headers allow the server to send meta data about the response from the server to the client. There is nothing that would cause the browser to return your custom headers (unles you've built your own client).
Furthermore, even if there was, in your case, you're trying to read them before the response has ever gone to the client (forwards don't involve a trip down to the client).
As suggested earlier, request attributes, are what you would use to pass values between components within a request.
And, as Satou has suggested, you would be doing all of our eyes a favor if you fixed the casing in your name. You can do it here.