• Post Reply Bookmark Topic Watch Topic
  • New Topic

Response Headers  RSS feed

 
Sarthishari Kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
Am new to Servlet Programming.
is there a way to look into the Response Headers and values using Servlets???
Waiting for ur reply.
Sathish
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

is there a way to look into the Response Headers and values using Servlets???

There are a number of methods on the HttpServletRequest API that deal with getting the headers. Start with request.getHeader().
Similarly, methods exist on HttpServletResponse to set them.

Waiting for ur reply.

Please avoid freeze-drying perfectly good words like "your" in posts. It just makes them difficult to read.
hth,
bear
[ May 02, 2003: Message edited by: Bear Bibeault ]
 
Sarthishari Kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear
Thanks for YOUR reply..
Just for fun.
Am used to writing like that.
yeah, there are methods to set Response Headers.
What i want is to get the Response Headers???
Can it be done???
Waiting for your reply.
Sathish
 
Murali Nanchala
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you are writing the servlet, you are providing the response. So you set the headers. Why would you try to get them?
Outside of the servlet container, you don't have access to the ServletResponse Object. What use are methods to get the headers from it when there is no reference to the Object?
 
Chris Smith
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Murali is right. There's no way to get previously set response headers. Perhaps you can elaborate on the problem you're trying to solve? If it involves communication between servlets and JSPs that forward and include between each other, then request attributes would be more appropriate. The final servlet in your list, then, could read those back and set them as response headers instead.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!