You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2007/04/28 01:58:24 UTC

[Tapestry Wiki] Update of "Override Tapestry Default Exception Page" by JoshJoy

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 JoshJoy:
http://wiki.apache.org/tapestry/Override_Tapestry_Default_Exception_Page

New page:
How To Override Tapestry Default Exception Page

For development purposes, the tapestry exception page is extremely useful. It provides very informative info for development purposes, such as stack trace info, displays environment settings, etc...
However, for a production environment, one may want to override this error page. This tutorial will explain how to.


1. Create html Error Page

2. Create corresponding java page

{{{
public class ErrorPage extends BasePage {
    public void setException(Throwable value){
        System.out.println("tapestry stack trace");
        value.printStackTrace();
        try {
                /* Send email with the error msg  */
        	EmailService.sendEmail(value);
        } catch (Throwable exept) {
              log error
	} 
    }
}

}}}

3. Modify hivemodule.xml
Add the following
{{{
	<contribution configuration-id="tapestry.InfrastructureOverrides">
	      <property name="exceptionPageName" value="ErrorPage"/>
	</contribution>
}}}


Note, may want to consider have the deployment process only override the tapestry default exception page for production environment.



References

1. Email tapestry listserve Matt Larson, jake123; Subject title "Create error page T4.0.2"

2. http://tapestry.apache.org/tapestry4.1/developmentguide/exceptionpages.html

3. http://tapestry.apache.org/tapestry4/tapestry/hivedocs/config/tapestry.Infrastructure.html

4. http://issues.appfuse.org/browse/APF-271

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org