首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用deployerContextConfig配置Jasig

使用deployerContextConfig配置Jasig
EN

Stack Overflow用户
提问于 2014-08-03 20:31:39
回答 1查看 1.4K关注 0票数 0

我正在研究Jasig CAS版本3.5.2.1的实现

CAS 3.5.2.1是一个Spring3.1MVC应用程序。

目前,该应用程序使用ContextLoaderListener从名为deployerContextConfig.xml的xml文件中填充WebApplicationContext

我可以在cas.properties文件中使用属性(例如从deployerContextConfig.xml文件中加载的属性)吗?如果是这样的话,是怎么做的?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-06 18:13:29

我使用的是CAS 3.5.0,但我认为这将与您的版本相同。首先,web.xml将在/web.xml/spring-配置目录和/web.xml/部署ConfigContext.xml中加载所有的*.xml文件。

代码语言:javascript
复制
<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文件

代码语言:javascript
复制
<bean id="propertyPlaceholderConfigurer" 
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
    p:location="/WEB-INF/cas.properties" />

在deployerConfigContext.xml内部:

代码语言:javascript
复制
<!-- 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:

代码语言:javascript
复制
ldap.repository.server.urls=ldap://ldap.usfca.edu:389
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25108820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档