cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathias Reem" <>
Subject Cocoon 2.2 error handlers
Date Tue, 28 Apr 2009 07:53:23 GMT

I've got a problem with the error handling in cocoon 2.2. If a file can not be found I would
like to present a custom errorpage to the user, but also give him the 404 error code.

I do get the custom error page, but error code is not 404 but 200. :-(

My sitemap.xmpa looks like:
<map:selectors default="resource-exists">
 <map:selector name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
  <exception name="not-found" class="org.apache.cocoon.ResourceNotFoundException"/>
  <exception class="java.lang.Throwable" unroll="true"/>
<map:serializers default="xhtml">
 <map:serializer name="xhtml" src="org.apache.cocoon.serialization.XMLSerializer">
  <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
  <map:match pattern="**/*.html">
   <map:generate  type="file"  src="{global:root}/{1}{2}.xml"/>
   <map:call resource="post-process-and-serialize">
    <map:parameter name="resource" value="{global:root}/{1}/{2}.xml"/>
  <map:select type="exception">
   <map:when test="not-found">
    <map:generate  type="file"  src="resource/websys/errorpage/404.html"/>
    <map:serialize type="xhtml" status-code="404"/>
    <map:generate  type="file"  src="resource/websys/errorpage/500.html"/>
    <map:serialize type="xhtml" status-code="500"/>

Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message