You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2013/03/31 16:08:11 UTC

svn commit: r1462963 - /incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext

Author: gpetracek
Date: Sun Mar 31 14:08:11 2013
New Revision: 1462963

URL: http://svn.apache.org/r1462963
Log:
updated content

Modified:
    incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext

Modified: incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext?rev=1462963&r1=1462962&r2=1462963&view=diff
==============================================================================
--- incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext (original)
+++ incubator/deltaspike/site/trunk/content/deltaspike/jsf.mdtext Sun Mar 31 14:08:11 2013
@@ -345,7 +345,53 @@ leads to the invocation of the pre-rende
 it won't be called for other pages).
 
 ### Configuring a Default Error-View
-[TODO]
+It's possible to mark one view-config class as default error-view. That means in case of errors it will be used as navigation target automatically.
+Furthermore, it's also possible to use it in your code instead of hardcoding the error-view across the whole application.
+
+In case of
+
+    :::java
+    interface Pages {
+        class Index implements ViewConfig { }
+
+        class CustomErrorPage extends DefaultErrorView { }
+    }
+
+it's possible to navigate with `DefaultErrorView.class` instead of hardcoding it to `Pages.CustomErrorPage.class`.
+    
+    :::java
+    @Model
+    public class PageController
+    {
+        public Class<? extends ViewConfig> actionWithoutError()
+        {
+            return Pages.Overview.class;
+        }
+
+        public Class<? extends ViewConfig> actionWithError()
+        {
+            //navigates to the view which is configured as default error-view
+            return DefaultErrorView.class;
+        }
+    }
+
+If you are outside of an action-method you can also use it in combination with `ViewNavigationHandler`.
+
+    :::java
+    @Model
+    public class AnyController
+    {
+        @Inject
+        private ViewNavigationHandler viewNavigationHandler;
+
+        public void anyMethod()
+        {
+            //navigates to the view which is configured as default error-view
+            this.viewNavigationHandler.navigateTo(DefaultErrorView.class);
+        }
+    }
+
+However, in case of JSF you have to ensure that you are at a valid point in the JSF request-lifecycle for a navigation, because invocation gets transformed to a std. (implicit) JSF navigation.
 
 ### Using @Matches
 [TODO]