3 Replies Latest reply on May 30, 2009 7:45 PM by Greg Zoller

    Understanding @In and contexts (page and session)

    Greg Zoller Newbie

      Hello,


      I have a page-scoped component in which I'm trying to inject a session-scoped component.


      I tried the following, but cart is null, even though I can go to the debug page and clearly see it in my session scope.




      @Name("lineScroller")
      @Scope(ScopeType.PAGE)
      public class CartLinesScrollerVO {     
           @In private CartVO cart; // cart is null, even though it exists in session scope




      But this works:


      @Name("lineScroller")
      @Scope(ScopeType.PAGE)
      public class CartLinesScrollerVO {
           private CartVO cart = (CartVO) Contexts.lookupInStatefulContexts("cart");
      
      




      Why does this work but the first one won't?


      Thanks,
      Greg