java - How to get web session on Spring AOP -
i have question using spring aspectj. want create audit log when user , user information web session create audit log. can provide examples of how this?
spring mvc's dispatcherservlet stores request in thread-local variable (if don't use spring mvc, may declare requestcontextlistener in web.xml same thing). variable can accessed via requestcontextholder:
httpsession s = (httpsession) requestcontextholder                     .currentrequestattributes()                     .resolvereference(requestattributes.reference_session);      
Comments
Post a Comment