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 Mon, 14 May 2007 15:21:30 GMT
Reinhard Poetz skrev:
> Daniel Fagerstrom wrote:
>>> What about reversing the logic: Instead of
>>> >>> <map:match pattern="test5">
>>> >>>   <map:generate type="servletService" src="test.html">
>>> >>>     <map:parameter name="service" 
>>> value="servlet:test2:/extract-html"/>
>>> >>>   </map:generate>
>>> >>>   <map:serialize type="xml"/>
>>> >>> </map:match>
>>> we could use
>>> <map:match pattern="test5">
>>>   <map:generate type="servletService" 
>>> src="servlet:test2:/extract-html">
>>>     <map:parameter name="data" value="test.html"/>
>>>   </map:generate>
>>>   <map:serialize type="xml"/>
>>> </map:match>
>>> It doesn't make that much difference for generators, but would save 
>>> one line each for serializers and transformers.
>>> WDYT?
>> It would save a line, but especially for the generator it would 
>> obscure the function. For all other generators the src parameter is 
>> used for *reading* stream input. With your proposal the data 
>> parameter would instead get that role and the src parameter would be 
>> used as something that is a service that you post something to. I 
>> think that would be more confusing.
>> Also for the servlet service transformer and serializer, "src" sound 
>> like something you read from rather than something you post to.
> hmm, the "src" attribute of generators desribes, what is feed into the 
> component. In the case of a servlet service generator, the output 
> stream of a servlet is used as stream input.
Rather something that is transformed to SAX output.
> The "data" parameter defines the content that is passed to the servlet 
> service. IMO that's not the starting point of the generator.
IMO it is ;)

The normal case:

Source ==[octet stream]==> Generator ==[SAX]==> ...

Servlet service generator as I see it:

Source ==[octet stream]==> Generator ==[SAX]==> ...
                              |  ^
                              v  |

As you can see, the connection to the servlet service is something that 
differ from the ordinary generator usage, and because of that it is 
natural to put it in a parameter.


View raw message