private static void processApplicationSecurityException(AccessDeniedException exception,
Class<? extends ViewConfig> errorView,
boolean allowNavigation)
{
SecurityViolationHandler securityViolationHandler =
BeanProvider.getContextualReference(SecurityViolationHandler.class, true);
if (securityViolationHandler != null)
{
//optional (custom handler) - allows to handle custom implementations of SecurityViolation
securityViolationHandler.processSecurityViolations(exception.getViolations());
}
else
{
addViolationsAsMessage(exception.getViolations());
}