|
|
Hello all!
I'm trying to make a audit system but I need some user information stored in the fromSession to save in an audit table, so I need to inject the session object in the interceptor object. Is it possible?
thanksTaka
Not as far as I know. Create a Filter which stores this information in a ThreadLocal, then in your interceptor retrieve the information from this ThreadLocal.
You also might want to checkout the new spring scopes (in your case session) which could help you.
However the ServletFilter/ThreadLocal approach works anyway.
I'll try this servlet/threadlocal approuch and post here if I succeed.
Thank you!
I can only stress Marten's comment about the new scopes. Maybe you can rethink your architecture. With the user information being a session scoped bean all the user info handling is transparent and decoupled from web environment.
Jörg |
|