cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Stevens" <at...@hotmail.com>
Subject RE: Setting HTTP Response Code
Date Fri, 28 Jul 2006 16:43:22 GMT
>From: alarcher <antoinelarcher@gmail.com>
>Date: Fri, 28 Jul 2006 05:59:27 -0700 (PDT)
>
>Hi folks,
>
>Does somebody knows if there's a way to set http response code directly
>inside a sitemap 's matcher ?
>
>I know there's a way to do that in an Action : getting HttpServletResponse
>through ObjectModelHelper, and setting error code on response.
>
>But, is there a common action which permits that ?

I don't know if there's an action, but

<map:redirect-to uri="whatever" permanent="yes"/>

lets you choose between a 301 and 302 on a redirect depending on the 
"permanent" value.  And if you look at the error handling stuff in the 
default sitemap you'll see

<map:serialize status-code="404"/>
and
<map:serialize status-code="500"/>

so the default serializer can certainly set the status.  Do either of those 
do what you want?


Andrew.



Mime
View raw message