title: Using JSF, JPA and DAO. Without Spring?
body: <p>till now i still worked with JSF and JPA without DAOs. Now i'd like to use DAOs. But how can i initialize the EntityManager in the DAO-Classes?</p>
  
  <pre><code>public class AdresseHome {
  
      @PersistenceContext
      private EntityManager entityManager;
  
      public void persist(Adresse transientInstance) {
          log.debug("persisting Adresse instance");
          try {
              entityManager.persist(transientInstance);
              log.debug("persist successful");
          } catch (RuntimeException re) {
              log.error("persist failed", re);
              throw re;
          }
      }
  }
  </code></pre>
  
  <p>Have I to use Spring or is there a solution that works without Spring?</p>
  
  <p>Thanks.</p>