This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

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:


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

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");

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

Joined: Nov 24, 2005
Posts: 14688

Please do not post the same question twice :

[My Blog]
All roads lead to JavaRanch
It is sorta covered in the JavaRanch Style Guide.
subject: problem in request.getHeader()
It's not a secret anymore!