Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for 
change notification.

The following page has been changed by NickWestgate:
http://wiki.apache.org/tapestry/Tapestry5ExceptionPage

New page:
= 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 
[http://tapestry.apache.org/tapestry5/tapestry-core/guide/request.html here] 
(or check the T5 source).

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.

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>

}}}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to