aspose file tools*
The moose likes Servlets and the fly likes problem in request.getHeader() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

problem in request.getHeader()

Arun Prasath
Ranch Hand

Joined: Aug 14, 2006
Posts: 30
--------------------------------------------------------------------------------
i have some problem in using request.getHeader(String)

In a servlet my i set a header.
The code is:

response.setHeader("Arun","Prasath");


RequestDispatcher rd=request.getRequestDispatcher("index.jsp");
rd.forward(request,response);


Then i forward it to a jsp page ie,index.jsp


In the index.jsp i get the following result:

String ss=(String)request.getHeader("Arun");
out.println(ss);

The result i get while print the String is null.I expect the header value
prasath to be printed.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Please do not post the same question twice :
http://www.coderanch.com/t/363170/Servlets/java/request-getHeader


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in request.getHeader()