cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kjetil Kjernsmo <Kjetil.Kjern...@computas.com>
Subject Send status code with error handler
Date Fri, 17 Oct 2008 09:41:06 GMT
Hi all!

I have a very simple exception handler in my sitemap:

    <map:selectors>
      <map:selector name="exception" 
src="org.apache.cocoon.selection.ExceptionSelector">
	<map:exception name="processing" class="java.lang.Exception"/>
      </map:selector>
    </map:selectors>

so that the user will never see a stacktrace.

We have a servlet service listening in a different sitemap, the setup looks 
like this:

      <map:handle-errors>
	<map:generate src="servlet:skin:/resources/errors/general.xml"/>
	<map:serialize type="servletService" status-code="500">
          <map:parameter name="service" 
value="servlet:skin:/sublima-styling"/>
	</map:serialize>
       <map:serialize type="html"/>
      </map:handle-errors>

This works great, except for one thing: I still want to send the 500 HTTP 
code, even though the user gets a pretty page. I've tried to set the 
status-code attribute on both map:serialize elements, but it doesn't work. 

How is this supposed to work?

Kind regards 

Kjetil Kjernsmo
-- 
Senior Knowledge Engineer
Mobile: +47 986 48 234
Email: kjetil.kjernsmo@computas.com   
Web: http://www.computas.com/

|  SHARE YOUR KNOWLEDGE  |

Computas AS  PO Box 482, N-1327 Lysaker | Phone:+47 6783 1000 | Fax:+47 6783 
1001


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message