打开deployerConfigContext.xml
<bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"
p:backingMap-ref="attrRepoBackingMap" />
将以上代码替换成以下代码:
<bean id="attributeRepository" class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
<!-- 指定使用的数据源,此处dataSource是已配置好的数据源 -->
<constructor-arg index="0" ref="dataSource" />
<!-- 从数据库中查询信息的SQL语句,通常只需要修改表名即可 -->
<constructor-arg index="1" value="select * fromuserinfo where {0}" />
<property name="queryAttributeMapping">
<map>
<!-- 上述查询的参数,将userName替换为表中表示用户名的字段名称 -->
<entry key="username" value="userName" />
</map>
</property>
<property name="resultAttributeMapping">
<map>
<!-- 需要返回给Web应用的其它信息,多个信息时可继续增加entry节点 -->
<!--key值为数据表中的字段名称,value值为Client端取值时的名称标识 -->
<entry key="address" value="address" />
</map>
</property>
</bean>
接着在这个文件最后的 bean class=”org.jasig.cas.services.RegexRegisteredService” 标签内加上 p:ignoreAttributes=”true”