Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding new header to Request

 
Travis Gibson
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Fellow Ranchers,
Here's a question that I have run into.
In a servlet, is it possible to insert a new header into the request before forwarding to a second servlet?
I'd like to avoid any kind of URL encoding if possible.
Regards,
Travis Gibson www.travismgibson.com
travis@travismgibson.com
 
Travis Gibson
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ranchers,

In answered my own question(Don't you love when that happens)!!
Here's how it's done:
request.setAttribute(String fieldName, Object fieldValue);
then in the second servlet you do in order to get the passed value:
request.getAttribute(String fileName);
Sweet!!
Regards,

Regards,
Travis Gibson, SCJP
Java Developer www.travismgibson.com
travis@travismgibson.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic