1 Reply Latest reply on Jan 28, 2011 2:00 PM by monkeyden

    Access Factory in code

    vata2999

      Hi,
      i created a Factory returns userList i want to know
      how can i access it in component bean ?

        • 1. Re: Access Factory in code
          monkeyden

          just inject it, using the same name specified in the factory annotation.  e.g.:


          @Factory("userList")
          public List<User> loadUsers(){
             List<User> users =...
             //do stuff to load users
             return users;
          }
          



          then, in what you refer to as component bean:


          @In
          List<User> userList;