tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschu...@apache.org
Subject svn commit: r569729 - /tapestry/tapestry4/trunk/src/site/apt/developmentguide/exceptionpages.apt
Date Sat, 25 Aug 2007 20:25:37 GMT
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);
+        }
+    }
+}  
 +-----------------------------------------------------------



Mime
View raw message