aspose file tools*
The moose likes Java in General and the fly likes Anyone know how to generate a HttpServletRequest with Headers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Anyone know how to generate a HttpServletRequest with Headers?" Watch "Anyone know how to generate a HttpServletRequest with Headers?" New topic
Author

Anyone know how to generate a HttpServletRequest with Headers?

Ron Ditch
Ranch Hand

Joined: May 16, 2002
Posts: 33
I'm currently working on a project where I am building a web application that is wrapped by IBM's Portal Server and Tivoli Access Manager. One of the dependencies that my web application has on Tivoli Access Manager (TAM) is that TAM appends the login id (from the portal) of the user to a request in a header. I then use this login id to access the user's information out of a persistant resource. Thus, when the remote web application receives a request from the portal, TAM includes the portal id of the user in a header, and I strip it out of the request.
Unfortuntately, WPS and TAM are not exactly easy to setup, and my customer needs to perform acceptance testing against the web app I'm building independent of WPS and TAM. It would be very, very difficult to have the customer setup the necessary environment to complete their acceptance testing, so I need another solution.
Here's my quandry... I want to be able to create a testing harness for my customer that would allow me to generate HTTPServletRequests with header values inside of it so I don't have to have the customer setup IBM Portal Server and TAM. However, I don't know how to generate HTTPServletRequests with Headers.
Any suggestions on how to do this?
Ron Ditch
Ranch Hand

Joined: May 16, 2002
Posts: 33
anyone???
Pete Kelly
Greenhorn

Joined: Jul 13, 2002
Posts: 2
I suggest you look at jakarta's Cactus and possibly using Mock Objects.
http://jakarta.apache.org/cactus/
Good Luck,
Pete
 
jQuery in Action, 2nd edition
 
subject: Anyone know how to generate a HttpServletRequest with Headers?