File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Adding new header to Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Adding new header to Request" Watch "Adding new header to Request" New topic
Author

Adding new header to Request

Travis Gibson
Ranch Hand

Joined: Oct 17, 2000
Posts: 100
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


Regards,<BR>Travis M. Gibson, SCJP<BR>Java Developer<BR>www.travismgibson.com<BR>travis@travismgibson.com
Travis Gibson
Ranch Hand

Joined: Oct 17, 2000
Posts: 100
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding new header to Request