Thanks for that, here is my working version!

@Stateful
  | @Name("mySession")
  | @Scope(ScopeType.SESSION)
  | @Interceptors(SeamInterceptor.class)
  | @Cache(NoPassivationCache.class)
  | public class MySessionBean implements Serializable, MySession {
  | 
  |     @PersistenceContext
  |     private EntityManager entityManager;
  |     
  |     @RequestParameter("CompanyID")
  |     private String paramCompanyId;
  |     
  |     @RequestParameter("UserID")
  |     private String paramUserId;
  |     
  |     private Company company;
  | 
  |     private User user;
  | 
  |     @Out
  |     @Factory("company")
  |     public Company getCompany() {
  |         if (paramCompanyId != null) {
  |             company = entityManager.find(Company.class, new 
Integer(paramCompanyId));
  |         }
  | 
  |         return company;
  |     }
  | 
  |     @Out
  |     @Factory("user")
  |     public User getUser() {
  |         if (paramUserId != null) {
  |             user = entityManager.find(User.class, new Integer(paramUserId));
  |         }
  | 
  |         return user;
  |     }
  | 
  |     @Create
  |     public void init() {
  |         System.out.println("MySessionBean.init()");
  |     }
  | 
  |     @Destroy
  |     @Remove
  |     public void destroy() {
  |         System.out.println("MySessionBean.destroy()");
  |     }
  | }
  | 

Which I can access from the view using:

<af:outputText value="#{company.name}"/>
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3925826#3925826

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3925826


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to