Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Headers Problem

 
Phanindra varma
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can anybody help me from this headers problem.
i added the code in servlets like
response.setHeader("somestring","value");
i am sending the headrs to another servlet. there i am trying to
print the header value with this
String val = request.getHeader("somestring"); but i am getting null
value can any body tell me why i am getting null value. Thanks in
advance.
[ August 02, 2005: Message edited by: Phanindra varma ]
 
Manzar Zaidi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont understand fully what you are trying to achieve there.

You are adding a header to response and try to extract it from reqyest.

Perhaps I should highlight it that response is what you send to the client, it is viewable at the browser that requested the content . You can see the header you set if you view the headers of the response page opened at the client browser.

But the request headers are sent by the browswer, you cant control them from the server.

If you want to have some information sent along the response and have the client send it back to you , you need to use the cookies.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic