cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Make status code attribute of seriailzers expandable
Date Fri, 30 Mar 2007 07:43:02 GMT
</snip>

> 
> I'm sorry, but I can't spot a difference between these two options:
> 
>    <map:serialize type="xhtml" pragma="{cache}" 
> cache-control="{cache}"/>
> 
> and:
> 
>    <map:act type="header">
>      <map:parameter name="pragma" value="{pragma}"/>
>      <map:parameter name="cache-control" value="{cache}"/>
>    </map:act>
>    <map:serialize type="xhtml"/>
> 
> In both cases, sitemap parameter expansion will happen while 
> sitemap is executed 
> and pipeline is built. In first case you'd presumable set 
> response headers in 
> Serializer.setOutputStream() method, which is happening a bit 
> later comparing 
> with Action.act() of the second case, but still it should be 
> the same effect, 
> isn't it?

In this example, there is really no difference in output indeed, but if you have one catch
all matcher with one single serializer which is always used for every request (I always use
<map:match pattern="**" and then an aggregate below it that aggregates content with map:parts
that delegate to subsitemaps ). So, all request eventually use the same serializer. I cannot
know in this matcher, that there will be a form with contiuation, so I cannot set the header
in this pipeline (then stateless flat html pages would get a pragma no-cache header for example).


And, thx Bertrand for finding back the discussion [1], in combination with the problem that
setting http headers on internal pipelines do not make it to the main pipepipeline, therefor,
my suggestion to store it like the status-code in a variable. Ofcourse, when [1] is easier
to fix, that would probably be the better way to go.

[1] https://issues.apache.org/jira/browse/COCOON-1619

Ard

> 
> Vadim
> 

Mime
View raw message