• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

header and headerValues

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic