cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <>
Subject Re: More problems with implementing servlet services
Date Fri, 11 May 2007 12:03:43 GMT
Vadim Gritsenko skrev:
> Grzegorz Kossakowski wrote:
>> Given that mime type (and other http header informations) are 
>> calculated during setup phase of service's pipeline setup phase it's 
>> guaranteed that this information can be properly determined without 
>> providing any content (in service call, it's POSTed one). Thus, it's 
>> enough to perform HTTP HEAD request that does not post any data and 
>> does not expect any data returned by the service.
>> It means that serializer will need to perform two requests:
>> 1. HTTP HEAD which is meant only to collect all data required to set 
>> all http headers correctly (including Content-Type)
>> 2. Actual HTTP POST that POSTs the data and gets transformed data 
>> returned by the service
>> The obvious drawback of this method is that we need to perform two 
>> requests. However, first one should be really cheap because pipeline 
>> needs only to setup components to gather all required meta 
>> information, no processing will be performed.
> IIUC, generally this will not work. Suppose that you are calling this 
> simple sitemap:
>   <map:generate src="file.xml"/>
>   <map:act type="authenticate">
>     <map:act type="delete">
>       <map:transform src="file.xsl"/>
>       <map:serialize mime-type="foo/bar"/>
>     </map:act>
>     <map:serialize status-code="404"/>
>   </map:act>
>   <map:serialize status-code="401"/>
> Building this pipeline twice will invoke delete action twice - and 
> this would give two different results.
Exactly, an implicit, automatic HTTP HEAD handling would work for 
sitemap rules that are idempotent (i.e. calling any number of times 
gives the same result as calling once, which GET is supposed to be even 
if that not always is the case). But for any sitemap with actions or 
flowscripts it would typically not work.

One could have automatic HTTP HEAD handling anyway, and combining it 
with explicit sitemap (or flowscript rules) for HEAD handling in those 
cases where it is needed. But this of course leaves a lot of 
possibilities for mistakes for the users.


View raw message