spring中加载properties文件
程序员文章站
2022-07-04 08:45:24
...
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:ldap.properties</value>
</property>
</bean>
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="${url}" />
<property name="base" value="${base}" />
<property name="userDn" value="${userDn}" />
<property name="password" value="${password}" />
</bean>
ldap.properties文件:
url=ldap://61.xxx.xxx.xxx:389
base=o=mycom.com,c=cn
userDn=cn=root,o=mycom.com,c=cn
password=secret
上一篇: LINQ
下一篇: 加载属性文件Properties