----- Original Message -----
From: "David Rogers" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 16, 2003 10:14 PM
Subject: Using <map:handle-errors>
>
>
> Hi,
>
> I can't get the <map:handle-errors> portion of the pipeline to execute.
> Do I have to define a selector or do something else besides this?
>
> I want the pipeline to return an xhtml file if it cant find the requested
> xml file.
>
> This is the pipeline:
> Any idea what else i should be doing? I am using 2.1.1
>
> Thanks,
> Dave
>
> <map:pipeline>
> <!--*****************************************-->
> <map:match pattern="*/*/*.xml">
> <!--*****************************************-->
> <map:aggregate element="included" >
> <!--map:part src="cocoon:/request"/-->
> <map:part src="{1}/siteconfig/session.xml"/>
> <map:part src="cocoon:/session/appState"/>
> <map:part src="{1}/{2}/{3}.xml"/>
> </map:aggregate>
>
> <map:transform src="_common/_xsl/displayarea.xsl"/>
> <map:transform src="_common/_xsl/widget.xsl"/>
> <map:transform src="_common/_xsl/dinclude.xsl"/>
> <map:transform src="_common/_xsl/stripper.xsl"/>
> <map:transform type="cinclude"/>
>
> <map:serialize type="xml" />
> </map:match>
>
> <map:handle-errors>
> <map:generate src="{1}/xhtml/filenotfound.xhtml"/>
> <map:serialize type="xml"/>
> </map:handle-errors>
>
> </map:pipeline>
Hello,
you need an exception selector for example. Look at the code snipplet as
follows...
...
<map:selector name="exception"
src="org.apache.selection.ExceptionSelector">
<exception name="notFound"
class="FileNotFoundException"/>
...
</map:selector>
...
<map:pipeline>
...
<map:handle-errors>
<map:select type="exception">
<map:when test="notFound">
<map:generate src="FileNotFound.html"/>
<map:serialize type="html"
status-code="404"/>
</map:when>
</map:select>
</map:handle-errors>
</map:pipeline>
...
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]