0

Jasig CASバージョン3.5.2.1の実装に取り​​組んでいます

CAS 3.5.2.1 はSpring 3.1 MVCアプリケーションです。

現在、アプリは ContextLoaderListener を使用して、deployerContextConfig.xmlというxml ファイルからWebApplicationContextを設定します。

deployerContextConfig.xmlファイル内でプロパティー ( cas.propertiesからロードされたものなど) を使用できますか? もしそうなら、どのように?

4

1 に答える 1

0

私はCAS 3.5.0を使用していますが、あなたのバージョンと同じだと思います。まず、web.xml は /WEB-INF/spring-configuration ディレクトリ内のすべての *.xml ファイルと /WEB-INF/deployerConfigContext.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:389
于 2014-08-06T18:13:29.137 に答える