cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: Handling "file not found errors"
Date Fri, 10 Oct 2008 10:57:18 GMT
Thanks Alexander
I know I do not quite "grok" this yet...
I have:
<map:selector name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
  <exception name="not-found" class="org.apache.cocoon.ResourceNotFoundException"/>
  <exception name="file-not-found" class=""/>
(after the last pipeline)
    <map:select type="exception">
      <map:when test="not-found">
        <map:generate type="file" src="docs/missing.xml"/>
	 <map:call resource="simple-page2html" status-code="404"/>
      <map:when test="file-not-found">
        <map:generate type="file" src="docs/missingfile.xml"/>
	 <map:call resource="simple-page2html" status-code="404"/>

Which does not seem to work ie. still get same error page below?


>>> On 2008/10/10 at 11:48, in message <>,
Alexander Daniel <> wrote:
On 10.10.2008, at 10:48, Derek Hohls wrote:

> Using Cocoon 2.1.8
> I am displaying data from a database that, in theory, contains
> URL links to files on the local server.  Occasionally, for various  
> reasons,
> the files are not available.  At the moment, Cocoon returns an
> informative - but ugly - error page:
> Resource not found
> [path to missing file] (The system  
> cannot find the file specified)
> Cocoon stacktrace[hide]
> Error during resolving of the input stream file: [...]myapp/ 
> sitemap.xmap - 335:73 <map:read>
> file: [...]myapp/sitemap.xmap - 887:66 <map:mount>
> Is there a way I can "trap" this error and display a custom page
> with a more friendly message?

This is possible with error handling [1].



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

This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice,
and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

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

View raw message