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

problem in request.getHeader()

 
Arun Prasath
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Report post to moderator
--------------------------------------------------------------------------------
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question twice :
http://www.coderanch.com/t/363170/Servlets/java/request-getHeader
 
    Bookmark Topic Watch Topic
  • New Topic