...
In place of the default <ph:ErrorHandler>
element in handler.xml something like the following is used:
Code Block |
---|
| xml |
---|
| xml |
---|
title | handler.xmlxml |
---|
|
<ph:ErrorHandler xsi:type="ph:VelocityErrorHandler" errorTemplatePath="error.vt" velocityEngine="shibboleth.MyVelocityEngine"/> |
The reference to the velocity engine is an example. It must contain the ID of a bean you define in a custom Spring configuration file such as the following:
Code Block |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd" >
<bean id="shibboleth.MyVelocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean" depends-on="shibboleth.LogbackLogging">
<property name="overrideLogging" value="false"/>
<property name="velocityProperties">
<props>
<prop key="runtime.log.logsystem.class">
edu.internet2.middleware.shibboleth.common.util.Slf4JLogChute
</prop>
<prop key="resource.loader">file</prop>
<prop key="file.resource.loader.class">
org.apache.velocity.runtime.resource.loader.FileResourceLoader
</prop>
<prop key="file.resource.loader.path">/opt/shibboleth-idp/conf</prop>
<prop key="file.resource.loader.cache">false</prop>
</props>
</property>
</bean>
</beans> |
Now you need to add your custom Spring configuration to the IdP's deployment descriptor:
Code Block |
---|
|
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>$IDP_HOME$/conf/internal.xml; $IDP_HOME$/conf/service.xml; $IDP_HOME$/conf/myext.xml</param-value>
</context-param> |
...