File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet Headers Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Headers Problem" Watch "Servlet Headers Problem" New topic
Author

Servlet Headers Problem

Phanindra varma
Greenhorn

Joined: Jul 29, 2005
Posts: 14
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

Joined: Oct 21, 2004
Posts: 43
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.


SCJP 1.2, SCWCD 1.4.<br />What goes around comes around ... with ver 1.1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Headers Problem
 
Similar Threads
Session tracking (via session object) Problem
NullPointerException and request.getParameter()
AppDos Vulnerability with BufferedReader.readLine()
Always responding invalidLogin.jsp
CommandLink Vs OutputLink in JSF