File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
Consider Paul's rocket mass heater.
 
subject: Response object does not have getHeader
 
Similar Threads
Setting headers
Adding headers
response.setHeader not working
setHeader
addheader and addcookie