cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: More problems with implementing servlet services
Date Fri, 11 May 2007 02:49:18 GMT
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.

Vadim

Mime
View raw message