Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

request.getHeader() returns null? why help me please

843841Aug 14 2006 — edited Aug 17 2006
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.

So advance thanks for helping
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2006
Added on Aug 14 2006
3 comments
3,051 views