概要:
如何在《学习二》基础上取当前App的所有用户信息。
正文
在Controller中直接Autowired systemRegistry发现有这个对象,但是这个对象总是返回空数组。
发现 可以采用下面的方法解决,但是不推荐:
第一步:spring-security.xml
在原《学习二》的基础上做了修改
...
<session-management invalid-session-url="/sessionexpired.jsp"
session-authentication-strategy-ref="mySessionAuthenticationStrategy">
</session-management>
<custom-filter ref="myFilter" before="FILTER_SECURITY_INTERCEPTOR"/>
</http>
...
<b:bean id="mySessionAuthenticationStrategy"
class="org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy">
<b:constructor-arg name="sessionRegistry" ref="sessionRegistry"/>