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

    Access Factory in code

    omid pourhadi Apprentice

      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
          Monkey Den Master

          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;