简体   繁体   中英

Spring mvc + security - session scoped beans

I have a web application that uses spring-security.

The spring security creates sessions for our users. Is it possible to tell spring security to store some reference in the session object for future lookup? If so is it possible to do using xml and/or annotations or do I need to extend some class or use one of the spring security "extension points"?

If it is not possible by using spring-security what is the proper way to add some attribute to session?

I am not expertise in spring-secutiry module but as per my knowledge if the spring security in creating session for you then on the controller(assumption) you can use request.getSession() to work with HttpSession object.

Regarding adding the attributes in the session, you can use some create some context inside HttpSession. The context will be an object(bean) that would have all the setters/getters to get required values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM