cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: More problems with implementing servlet services
Date Sat, 19 May 2007 12:09:27 GMT
On 18.05.2007 16:15, Daniel Fagerstrom wrote:

>> Right, but how about following situation when we have:
>> <map:generate src="somefile">
>>   <map:parameter name="service" value="servlet:B:/service/some"/>
>> </map:generate>
>>
>> Original request body cannot be passed to the called service untouched 
>> because we also have to pass data of somefile in request body. I was 
>> thinking about putting "somefile" data as another part but this surely 
>> requires parsing original parts, adding one more and serializing 
>> everything back to the request body of service call request.
> 
> When calling the servlet service source you are first creating a new 
> request and response object. The "request body" of the request object is 
> represented by the getInputStream method of the request object. For the 
> case above the request object created for the servlet service call will 
> contain the input stream from the FileSource that "somefile" is resolved 
> to.

...

> I think that the main thing to keep in mind is that when you are calling 
> as servlet service, you always build a new request and response object 
> that you use for the call.
> 
> Now, these new request and response object certainly can refer back to 
> the original request and response objects for reusing some info. But the 
> called servlet service should have *no* direct access to the original 
> request and response objects of the caller.

Grek's idea was about passing a combination of original request data AND 
additional file data. That's what you can't handle with your notation:

<map:generate src="<requestData>">
   <map:parameter name="service" value="servlet:B:/service/some"/>
</map:generate>

Where to add the need for <fileData>?

But I think the same applies to the other notation since you have only 
one parameter "postData". In both cases you might need to merge the data 
in another cocoon:/ pipeline (or are they completely discouraged/removed?).

Joerg

Mime
View raw message