aspose file tools*
The moose likes Servlets and the fly likes How come no response getHeader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How come no response getHeader" Watch "How come no response getHeader" New topic
Author

How come no response getHeader

James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Why isn't there a response.getHeader method?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The request object contains the headers sent from the client to the server.
The response object is where you set headers to be returned from the server to the client.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Understood. Our situation is that we have a SSO product in front of our App servers injecting header information into what I thought was the response headers. I can't check because I can't list the response headers, only the request headers...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

A common approach to this is to wrap the response with your own class that overrides the setHeader method.
This is common enough that the servlet spec provides an HttpServletRequestWrapper, and an HttpServletResponseWrapper class to help eliminate a lot of dumb typing.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponseWrapper.html
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How come no response getHeader