cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject HTTP error codes
Date Wed, 16 Apr 2003 14:31:06 GMT
Hi All

Is this the right way to send explicit HTTP error codes, with the new 
error-handler? It works, but I just want to make sure it is intended 
behaviour.

<map:handle-errors>
  <map:select type="exception">
   <map:when test="not-found">
    <map:generate src="not-found.xml"/>
    <map:transform src="welcome.xslt"/>
    <map:serialize status-code="404"/>
   </map:when>
   <map:otherwise>
    <map:generate type="notifying"/>
    <map:transform src="stylesheets/system/error2html.xslt">
     <map:parameter name="contextPath" value="{request:contextPath}"/>
    </map:transform>
    <map:serialize status-code="500"/>
   </map:otherwise>
  </map:select>
</map:handle-errors>

I need this as we have Apache using 'ProxyErrorOverride On' on our 
production box (but not on the dev box), so users see 'pretty' errors 
and developers get stacktraces.

Without the status codes, Cocoon always sends a 200.


thanks

regards Jeremy


Mime
View raw message