Differences between revisions 1 and 2
Revision 1 as of 2007-08-01 07:05:22
Size: 1273
Editor: NickWestgate
Comment:
Revision 2 as of 2009-09-20 23:20:04
Size: 1279
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
It's mentioned [http://tapestry.apache.org/tapestry5/tapestry-core/guide/request.html here] (or check the T5 source). It's mentioned [[http://tapestry.apache.org/tapestry5/tapestry-core/guide/request.html|here]] (or check the T5 source).
Line 6: Line 6:
Simply create your own page named [http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/corelib/pages/ExceptionReport.html ExceptionReport] which implements the [http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/services/ExceptionReporter.html ExceptionReporter] interface. Simply create your own page named [[http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/corelib/pages/ExceptionReport.html|ExceptionReport]] which implements the [[http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/services/ExceptionReporter.html|ExceptionReporter]] interface.

How to display your own exception page

As of T5.0.5 it's not documented yet but Tapestry's "ExceptionReport" page is what you have to override. It's mentioned here (or check the T5 source).

Simply create your own page named ExceptionReport which implements the ExceptionReporter interface.

Here's an example ...

ExceptionReport.java

package yourapp.tapestry.pages;

import org.apache.tapestry.services.ExceptionReporter;

public class ExceptionReport implements ExceptionReporter
{
    private String error;

    public void reportException(Throwable exception)
    {
        error = exception.getLocalizedMessage();
    }

    public String getError()
    {
        return error;
    }
}

ExceptionReport.html

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" >
<head>
    <title>Error</title>
</head>
    <body>
        Error: ${error}
    </body>
</html>

Tapestry5ExceptionPage (last edited 2009-09-20 23:20:04 by localhost)