• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Response Headers

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic