[java-identity-provider COMMIT] in /trunk/idp-conf/src/main/resources: conf/messages.properties system/conf/mvc-beans...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Jun 9 22:51:55 EDT 2014
Author: scantor
Date: Mon Jun 9 22:51:54 2014
New Revision: 6072
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6072&view=rev
Log:
Extend error template to exceptions thrown outside flow.
Modified:
trunk/idp-conf/src/main/resources/conf/messages.properties
trunk/idp-conf/src/main/resources/system/conf/mvc-beans.xml
trunk/idp-conf/src/main/resources/views/error.vm
Modified: trunk/idp-conf/src/main/resources/conf/messages.properties
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/conf/messages.properties?rev=6072&r1=6071&r2=6072&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/conf/messages.properties (original)
+++ trunk/idp-conf/src/main/resources/conf/messages.properties Mon Jun 9 22:51:54 2014
@@ -1,3 +1,5 @@
+# Event to error key mappings
+
AccessDenied = access
EndpointResolutionFailed = endpoint
@@ -31,6 +33,12 @@
UnableToEncode = unexpected
UnableToSign = unexpected
UnableToEncrypt = unexpected
+
+# Exception to error key mappings
+
+FlowExecutionRestorationFailureException = stale
+
+# Error key to title and message mappings
access.title = Access Denied
access.message = You do not have access to the requested resource.
Modified: trunk/idp-conf/src/main/resources/system/conf/mvc-beans.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/conf/mvc-beans.xml?rev=6072&r1=6071&r2=6072&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/conf/mvc-beans.xml (original)
+++ trunk/idp-conf/src/main/resources/system/conf/mvc-beans.xml Mon Jun 9 22:51:54 2014
@@ -37,7 +37,7 @@
<bean class="net.shibboleth.ext.spring.error.ExtendedMappingExceptionResolver">
<property name="exceptionMappings">
<props>
- <prop key="FlowExecutionRestorationFailureException">stale-error</prop>
+ <prop key="FlowExecutionRestorationFailureException">error</prop>
</props>
</property>
<!--
Modified: trunk/idp-conf/src/main/resources/views/error.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/views/error.vm?rev=6072&r1=6071&r2=6072&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/views/error.vm (original)
+++ trunk/idp-conf/src/main/resources/views/error.vm Mon Jun 9 22:51:54 2014
@@ -9,22 +9,23 @@
#if ($flowRequestContext)
#set ($eventId = $flowRequestContext.getCurrentEvent().getId())
- #set ($appContext = $flowRequestContext.getFlowExecutionContext().getActiveSession().getDefinition().getApplicationContext())
+ #set ($springContext = $flowRequestContext.getFlowExecutionContext().getActiveSession().getDefinition().getApplicationContext())
#set ($locale = $flowRequestContext.getExternalContext().getLocale())
- #set ($eventKey = $appContext.getMessage($eventId, null, "error", $locale))
- #set ($titleSuffix = $appContext.getMessage("${eventKey}.title", null, "Error", $locale))
- #set ($message = $appContext.getMessage("${eventKey}.message", null, "ERROR: $eventId", $locale))
+ #set ($eventKey = $springContext.getMessage($eventId, null, "error", $locale))
+ #set ($titleSuffix = $springContext.getMessage("${eventKey}.title", null, "Error", $locale))
+ #set ($message = $springContext.getMessage("${eventKey}.message", null, "ERROR: $eventId", $locale))
#if ($eventId == "AccessDenied")
$response.setStatus(403)
#end
+#elseif ($exception)
+ #set ($eventId = $exception.getClass().getSimpleName())
+ #set ($eventKey = $springContext.getMessage($eventId, null, "error", $request.getLocale()))
+ #set ($titleSuffix = $springContext.getMessage("${eventKey}.title", null, "Error", $request.getLocale()))
+ #set ($message = $springContext.getMessage("${eventKey}.message", null, "ERROR: $eventId", $request.getLocale()))
#else
#set ($titleSuffix = "Error")
- #if ($exception)
- #set ($message = "ERROR: $exception.getClass().getName()")
- #else
- #set ($message = "No specific error available")
- #end
+ #set ($message = "No specific error available")
#end
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
@@ -44,7 +45,7 @@
<div class="content">
#evaluate($message)
- </div>
+ </div>
</div>
<footer>
More information about the commits
mailing list