You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by ms...@apache.org on 2007/08/25 22:25:37 UTC
svn commit: r569729 -
/tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt
Author: mschulte
Date: Sat Aug 25 13:25:37 2007
New Revision: 569729
URL: http://svn.apache.org/viewvc?rev=569729&view=rev
Log:
fixes TAPESTRY-1693
Modified:
tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt
Modified: tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt?rev=569729&r1=569728&r2=569729&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt (original)
+++ tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt Sat Aug 25 13:25:37 2007
@@ -21,7 +21,7 @@
services:
+-----------------------------------------------------------
-<contribution configuration-id="tapestry.InfrastructureOverrides">
+<contribution configuration-id="tapestry.Infrastructure">
<property name="exceptionPageName" value="Exception"/>
<property name="exceptionPageName" mode="wml" value="WMLException"/>
@@ -50,7 +50,31 @@
<<<hivemodule.xml>>> configuration file:
+-----------------------------------------------------------
-<contribution configuration-id="tapestry.Infrastructure">
+<contribution configuration-id="tapestry.InfrastructureOverrides">
<property name="exceptionPageName" value="MyCustomExceptionPageName"/>
</contribution>
++-----------------------------------------------------------
+
+ Your page would have to have a property
+ called <<<exception>>>. A sample page class might look as follows:
+
++-----------------------------------------------------------
+public abstract class MyCustomExceptionPage extends BasePage
+{
+ private static Logger logger = Logger.getLogger(ExceptionPage.class);
+
+ @InitialValue("false")
+ public abstract boolean isPageNotFound();
+ public abstract void setPageNotFound(boolean pageNotFound);
+
+ public void setException(Throwable t)
+ {
+ logger.error("an exception occured", t);
+ if(t instanceof PageNotFoundException ||
+ t.getCause() instanceof PageNotFoundException)
+ {
+ setPageNotFound(true);
+ }
+ }
+}
+-----------------------------------------------------------