I have a SLSB service object that sends an email message using the renderer. This message needs access to an object in the scope of a method in my SLSB. Which approach is the right approach?
1) Biject this object in/out of a private member variable in my SLSB to be accessed inside my email xhtml template. (seems unnatural within a SLSB and prone to concurrency issues).
2) Assign this object to a context variable and remove from context after message is rendered. e.g.:
Contexts.getEventContext().set("myEntityObject", obj); this.sendInvalidLeadAlert(); Contexts.getEventContext().set("myEntityObject", null);
If #2 is the right approach, am I using the appropriate context? Anyone know anything about the METHOD context?
Thanks,
Rick
Method context is perfect for that, it's just ment for it ! Read Seam in Action
! It is a masterpiece. It will explain all details of Seam to you.