Hi Oleg, see inline.
> So, how about this? > > interface HttpContext { > > Object getAttribute(String); > void setAttribute(String, Object); > > } I would add these: public final static int SCOPE_LOCAL // default public final static int SCOPE_PARENT // uplevel 1 void setAttribute(String, Object, int scope) HttpContext getParent() > > interface HttpFilter { > > void preprocess(HttpRequest, HttpContext); > void postprocess(HttpResponse, HttpContext); > > } rather: interface HttpMessage { HttpContext getContext(); } interface HttpFilter { void preprocess(HttpRequest); void postprocess(HttpResponse); // or (HttpMessage), for the server side? } > > (2) The same HttpContext interface may aslo be used by the HttpClient > > (3) I do agree with you that the existing HttpFilter framework is not > sufficient to implement a fully functional redirect and authentication > handlers as these handlers may need to issue additional requests or > convert a request of one type to that of another. In other words one > request to one response relationship is not applicable here. > > (4) The HttpSequence can solve the problem quite elegantly > > interface HttpSequenceHandler { > > HttpRequest process(HttpResponse, HttpContext); > > } interface HttpSequenceHandler { HttpRequest process(HttpRequest, HttpResponse); } > > This framework seems simple yet flexible enough to accommodate for all > the use cases I know of. It is generic enough to be put into > http-common, leaving the details of concrete implementations up to > http-client and http-auth. > > What do you think? > > Oleg >