deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-717 invocation of exception handlers without error-view
Date Fri, 12 Sep 2014 13:28:31 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 5865f8cbf -> ab90cc4ee


DELTASPIKE-717 invocation of exception handlers without error-view


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/ab90cc4e
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/ab90cc4e
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/ab90cc4e

Branch: refs/heads/master
Commit: ab90cc4ee677e5bfc609ceed3708780cf2d97c0d
Parents: 5865f8c
Author: gpetracek <gpetracek@apache.org>
Authored: Fri Sep 12 15:27:07 2014 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Fri Sep 12 15:27:17 2014 +0200

----------------------------------------------------------------------
 .../impl/security/SecurityAwareViewHandler.java | 23 ++++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/ab90cc4e/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/security/SecurityAwareViewHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/security/SecurityAwareViewHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/security/SecurityAwareViewHandler.java
index 0ada120..1f29e09 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/security/SecurityAwareViewHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/security/SecurityAwareViewHandler.java
@@ -122,21 +122,26 @@ public class SecurityAwareViewHandler extends ViewHandlerWrapper implements
Deac
             ViewConfigDescriptor errorViewDescriptor = viewConfigResolver
                     .getViewConfigDescriptor(accessDeniedException.getErrorView());
 
-            if (errorViewDescriptor != null && View.NavigationMode.REDIRECT ==
+            try
+            {
+                if (errorViewDescriptor != null && View.NavigationMode.REDIRECT ==
                     errorViewDescriptor.getMetaData(View.class).iterator().next().navigation()
/*always available*/ &&
                     BeanProvider.getContextualReference(JsfModuleConfig.class)
-                            .isAlwaysUseNavigationHandlerOnSecurityViolation())
-            {
-                SecurityUtils.tryToHandleSecurityViolation(accessDeniedException);
-                errorView = errorViewDescriptor.getConfigClass();
+                        .isAlwaysUseNavigationHandlerOnSecurityViolation())
+                {
+                    SecurityUtils.tryToHandleSecurityViolation(accessDeniedException);
+                    errorView = errorViewDescriptor.getConfigClass();
+                }
+                else
+                {
+                    errorView = SecurityUtils.handleSecurityViolationWithoutNavigation(accessDeniedException);
+                }
             }
-            else
+            finally
             {
-                errorView = SecurityUtils.handleSecurityViolationWithoutNavigation(accessDeniedException);
+                broadcastAccessDeniedException(accessDeniedException);
             }
 
-            broadcastAccessDeniedException(accessDeniedException);
-
             return this.wrapped.createView(context, viewConfigResolver.getViewConfigDescriptor(errorView).getViewId());
         }
         finally


Mime
View raw message