Announcement Announcement Module
No announcement yet.
Separation of concerns... Is this possible? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Separation of concerns... Is this possible?

    I have a method which I call in a spring bean which takes an argument.

    i.e: saveTheObject(theObject)

    I wanted to create an auditing mechanism with the AOP interception features of spring but the problem I am running into is the auditing mechanism needs more info than just the stuff in theObject.

    It requires info about the user that's stored in the session.

    So what's the recommended way of passing the required info to AOP interceptor?

  • #2
    You can do a lookup for the information - the easiest way is to create a utility class or use a threadlocal which holds the http session - this way the AOP can get a hold of it and retrieve the required information.