cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Rogers" <d...@excira.com>
Subject RE: Using <map:handle-errors>
Date Sun, 16 Nov 2003 23:04:20 GMT

Hmm..thanks. still having trouble..

I am using a sub site map.
I see the main site map has the selector declaration already....

 <map:selector logger="sitemap.selector.exception" name="exception"
src="org.apache.cocoon.selection.ExceptionSelector">
     <exception class="org.apache.cocoon.ResourceNotFoundException"
name="not-found"/>
     <exception
class="org.apache.cocoon.components.flow.InvalidContinuationException"
name="invalid-continuation"/>
     <!-- The statement below tells the selector to unroll as much
exceptions as possible -->
     <exception class="java.lang.Throwable" unroll="true"/>
   </map:selector>


But when i try to refrence it using:

 <map:handle-errors>
      <map:select type="exception">
         <map:when test="not-found">
            <map:generate src="{1}/{2}/welcome.xml"/>
             <!--map:generate src="{1}/xhtml/filenotfound.xhtml"/-->
             <map:serialize type="xml"/>
          </map:when>
       </map:select>
 </map:handle-errors>

I still get the main erorr page with this...

java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: org.apache.cocoon.ProcessingException: Failed to
execute pipeline.: java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: java.lang.RuntimeException:
org.apache.cocoon.ResourceNotFoundException: Resource not found.:
org.apache.excalibur.source.SourceNotFoundException:
file:/C:/eclipse/workspace/MetaWorks/sites/doingatkins.com/repository/cautio
nn.xml doesn't exist.


almost there...
Thanks,
Dave






















-----Original Message-----
From: Stephan Coboos [mailto:cromosom@gmx.net]
Sent: Sunday, November 16, 2003 5:00 PM
To: users@cocoon.apache.org
Subject: Re: Using <map:handle-errors>



----- Original Message -----
From: "David Rogers" <dave@excira.com>
To: <users@cocoon.apache.org>
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org





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


Mime
View raw message