Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

header and headerValues

 
Ramya Iyer
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what I am doing incorrect....

in my servlet, i added a new header


But I am not able to retrieve the headers set in result1.jsp using both EL and scripting. I thought when view.include is called headers are not sent, but for forward headers are sent to the forwaded page. If that is the case why do I get blank for ${header.fruit} or <%=request.getHeader("fruit")%>. Pls clarify
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are setting the headers in servlet(web component-server side) and forwarding to JSP(another web component-server side) and trying to get the same header. How is it possible.

The method is called on "response" object, which means the result is send to the client. Using request.getHeader() you can access Headers that are send from the client and NOT send to the client.

Hope you can understand.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic