• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How come no response getHeader

 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why isn't there a response.getHeader method?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic