This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Add field in Http header in request  RSS feed

 
james goyal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add some fields in requesting header in my JSP and then want to get it in servlet.But i couldn't find any addheader method in httpServletRequest. So could any one tell me that how can fields can be added in header in request.
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot change the headers sent with the request. What type of fields are these, and why can't you pass them via form parameters?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't meddle with existing headers in a HttpServletRequest, however you can add arbitrary "attributes" which will be preserved when forwarding the request to a servlet. See the setAttribute and getAttribute methods in the ServletRequest interface.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!