| Author |
Response object does not have getHeader
|
Napu Sun
Ranch Hand
Joined: Apr 18, 2006
Posts: 33
|
|
Thanks mock exam in HFSJ. All of sudden, I found Response object has no getHeader method (but with setHeader and addHeader). But If I want to access the headers set in Response object, how can I do?
|
 |
NDP Prasad
Ranch Hand
Joined: Apr 13, 2006
Posts: 177
|
|
Response object dont need the getHeader. why think a bit? we have setHeader and addHeader in response because once if we forward the response to other jsp or servlets you can use it .
|
SCJP,SCWCD<br />
|
 |
Napu Sun
Ranch Hand
Joined: Apr 18, 2006
Posts: 33
|
|
|
Thanks NDP.
|
 |
Rancy Chadha
Ranch Hand
Joined: Jul 12, 2006
Posts: 135
|
|
Hi Prasad,
we have setHeader and addHeader in response because once if we forward the response to other jsp or servlets you can use it .
I dont quite agree with you on this. The reason I don't agree with you is that, whether you forward or include the response to other jsp or servlets, you are ultimately forwarding the original request and response objects that you have received from the client. Therefore even if you add or set headers on your response object it won't be available to the forwarded servlet.
|
Thanks,<br />-Rancy
|
 |
 |
|
|
subject: Response object does not have getHeader
|
|
|