我正在研究Jasig CAS版本3.5.2.1的实现
CAS 3.5.2.1是一个Spring3.1MVC应用程序。
目前,该应用程序使用ContextLoaderListener从名为deployerContextConfig.xml的xml文件中填充WebApplicationContext。
我可以在cas.properties文件中使用属性(例如从deployerContextConfig.xml文件中加载的属性)吗?如果是这样的话,是怎么做的?
发布于 2014-08-06 18:13:29
我使用的是CAS 3.5.0,但我认为这将与您的版本相同。首先,web.xml将在/web.xml/spring-配置目录和/web.xml/部署ConfigContext.xml中加载所有的*.xml文件。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring-configuration/*.xml
/WEB-INF/deployerConfigContext.xml
</param-value>
</context-param>/WEB-INF/spring-configuration/propertyFileConfigurer.xml将加载cas.properties文件
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/cas.properties" />在deployerConfigContext.xml内部:
<!-- Define the contextSource -->
<bean id="contextSourceRepository" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="pooled" value="false" />
<property name="urls">
<bean class="org.springframework.util.StringUtils"
factory-method="commaDelimitedListToSet">
<constructor-arg type="java.lang.String"
value="${ldap.repository.server.urls}" />
</bean>
</property>
<property name="userDn" value="${ldap.authentication.manager.userdn}" />
<property name="password" value="${ldap.authentication.manager.password}" />
<property name="baseEnvironmentProperties">
<map>
<entry key="com.sun.jndi.ldap.connect.timeout" value="${ldap.authentication.jndi.connect.timeout}" />
<entry key="com.sun.jndi.ldap.read.timeout" value="${ldap.authentication.jndi.read.timeout}" />
<entry key="java.naming.security.authentication" value="${ldap.authentication.jndi.security.level}" />
</map>
</property>
</bean>你的cas.properties:
ldap.repository.server.urls=ldap://ldap.usfca.edu:389https://stackoverflow.com/questions/25108820
复制相似问题