session - How do I get the Spring Security SessionRegistry? -
i can't seem find how reference spring security (v3) sessionregistry inside of struts action.
i've configured listener inside of web.xml file:
<listener> <listener-class>org.springframework.security.web.session.httpsessioneventpublisher</listener-class> </listener>
and i've tried use @autowired annotation bring action:
@autowired private sessionregistry sessionregistry; @override public string execute() throws exception { numberofusersloggedin= sessionregistry.getallprincipals().size(); return success; } public sessionregistry getsessionregistry() { return sessionregistry; } public void setsessionregistry(sessionregistry sessionregistry) { this.sessionregistry = sessionregistry; }
the http configuration looks this:
<session-management invalid-session-url="/public/login.do?login_error=expired" session-authentication-error-url="/public/login.do" session-fixation-protection="newsession"> <concurrency-control max-sessions="1" error-if-maximum-exceeded="true"/> </session-management>
generally more comfortable wiring spring bean myself, buy not sure how exposed using namespace. each time action executes, session registry null.
can point out doing wrong here, or show me way example?
thanks in advance any/all replies!
not sure if have referred session management section in spring security reference documentation. has snippet combining namespace , custom beans.
Comments
Post a Comment