Announcement Announcement Module
Collapse
No announcement yet.
Passing context information between different layer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing context information between different layer

    Hi,

    I am just wondering what would be the best aproach to create and pass information i.e context (request, session, user profile etc) between layors (Persentation/ Business / Persistence) using Struts, Spring and (Either EJB's or Hibernate). Is their already something built in Spring which is similar to WorkArea concept in WAS 6.0

    Thanks in advance

  • #2
    You usually won't want to pass something like request or session, as you want layers beneath the web to be independent of the web layer.

    If you want to avoid passing objects via method arguments, attaching objects to the current thread using ThreadLocal is a useful approach.

    Comment


    • #3
      Originally posted by katentim
      If you want to avoid passing objects via method arguments, attaching objects to the current thread using ThreadLocal is a useful approach.
      For an example of this, consider checking out Acegi Security Framework. It stores its security information inside a ThreadLocal, making it available anywhere in the Thread.

      Comment

      Working...
      X