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 2014/04/18 14:24:28 UTC

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

Author: gpetracek
Date: Fri Apr 18 12:24:27 2014
New Revision: 1588456

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

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

Modified: deltaspike/site/trunk/content/jsf.mdtext
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/jsf.mdtext?rev=1588456&r1=1588455&r2=1588456&view=diff
==============================================================================
--- deltaspike/site/trunk/content/jsf.mdtext (original)
+++ deltaspike/site/trunk/content/jsf.mdtext Fri Apr 18 12:24:27 2014
@@ -666,6 +666,29 @@ This annotation is a custom view-meta-da
         }
     }
 
+
+Since v0.7 it's possible to observe exceptions thrown by a @PreRenderView callback and use your configured Default-Error-View to display the exception.
+
+Example:
+
+    :::java
+    @ExceptionHandler
+    public class ErrorViewAwareExceptionHandler {
+        @Inject
+        private ViewConfigResolver viewConfigResolver;
+
+        public void onIllegalStateException(@Handles ExceptionEvent<IllegalStateException> e)
+        {
+            FacesContext facesContext = FacesContext.getCurrentInstance();
+
+            String viewId = viewConfigResolver.getDefaultErrorViewConfigDescriptor().getViewId();
+            UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
+            facesContext.setViewRoot(viewRoot);
+            //... - e.g.: store the exception in a page-bean for the default-error-view
+        }
+    }
+
+
 ### Referencing Views via @ViewRef
 With `@ViewControllerRef#value` you can annotate a view-config class to bind (/reference) a controller to it. `@ViewRef#config` allows the same in the other direction.
 Use an existing view-config to reference one or many view/s.