2 Replies Latest reply on May 25, 2006 7:28 PM by Dan Liu

    Inject object that is outjected from a stateless ejb.

    Dan Liu Apprentice

      Is it possible to inject object that is outjected from a stateless ejb? I've been having this problem for a couple of days now and really hope to get a solution here.

      I have a stateless ejb which is triggered from a bookmarked url. here is what it looks like:

      @Stateless
      @Name("shopAction")
      public class ShopAction ...
      {
       @RequestParameter
       String id;
      
       @Out
       List items;
      
       public void showShop(){
       items=getShopItems(id);
       }
      
      }
      


      As you can see it outject items to the jsf page. in my jsf page, each item has got a checkbox so user can tick the boxes and click "Buy now" to submit the request. Here I have a stateful bean which injects items, so it know what items the user has chosen.
      @Stateful
      @Name("bookAction")
      public class ShopAction ...
      {
      
       @In(scope=Conversation)
       List items;
      
       @Begin
       public String buyNow(){
       List selectedItem=getSelected(items);
       ....
       }
      }
      



      The code above doesn't work because Seam doesn't inject object from previous stateless operation.

      Is there anyway to pass outjected object from a stateless ejb to its following converstaion?