I'm working on a prototype where I hide the HttpServletRequest/Response 
objects and the various servlet goo-age behind HttpRequest/Response. 
Imagine that a servlet is calling out to a handler of a "service(...)" 
where the parameters are HttpRequest/Response, populated by the servlet 
prior to calling this handler.  I'm looking for best practices to do this, 
based on the design of the HttpCore classes and the expectations of 
clients that receive HttpRequest/Response objects.  I've done 
"TheGuidedTour..." and read some Javadoc.

HttpServletRequest headers: These seem straightforward enough - I just 
copy these into the headers of the HttpServletRequest.

HttpServletRequest parameters: Based on my reading of "GuidedTour..." I'm 
guessing that stuff this parameter map into some HttpParams derivation 
associated to the HttpRequest, and document the well-known key?

HttpServletRequest other data : Likewise, I stuff this data into 
HttpParams (either Basic or a specialized derivation)?

ServletRequest host info : I grab this data, put it into an HttpHost 
object, and associate it to the HttpRequest's HttpContext?

In dealing with the HttpResponse when shipping this data back out through 
the HttpServletResponse, I think I'm going to want to run the responses 
interceptors as well as checking headers.  If both a header and an 
interceptor for that header is defined, it looks like I should err-out, 
rather than prefer one over the other?

  -- Todd

Reply via email to