From: alarcher <[EMAIL PROTECTED]>
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.