aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Response object does not have getHeader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Response object does not have getHeader" Watch "Response object does not have getHeader" New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Response object does not have getHeader