On 14 Jul 2010, at 16:10, Bertrand Delacretaz wrote:

> On Fri, Jan 8, 2010 at 5:31 PM, Ian Boston <[email protected]> wrote:
>> ...We have been trying to implement a Batch method processor (ie a servlet 
>> that performs multiple requests batching
>> the responses up into a single request/response) in Sling.
>> 
>> Normally with servlets this would require 
>> requestDispacher.forward(wrappedRequest, wrappedResponse) but this doent
>> work since Sling unwrapps all request back to a internal 
>> SlingHttpServletRequestImpl object...
> 
> I'm hitting the same problem in my work on SLING-550, created
> https://issues.apache.org/jira/browse/SLING-1596 with a suggested
> patch, also at http://codereview.appspot.com/1783044
> 
> My solution is not perfect, to be clean I think we'd need to make
> RequestData a first-class interface instead of an implementation
> class, but my patch already decreases coupling a bit.
> 
> Reviews welcome.


I have a horrible feeling that if the unwrapped request is not a 
SlingHttpServletRequestImpl then other parts of the engine misbehave, which may 
have been the reason for enforcing that. It also allows anything to create a 
new Request, including scripted components. That may not be desirable.

However, if thats ok, then the patch looks good to me. 
I think we abandoned dynamic re-dispatch in favour of static binding to paths 
or explicit service calls.


also, did you mean to use tabs, afaik the rest of the code is space based and 
it can make life hard if the 2 are mixed ?

Ian


> -Bertrand

Reply via email to