我正在使用JSF创建一个小项目,并遇到了您可以在标题中阅读的错误。我已经研究了一个多小时而且找不到它,有人可以帮帮我吗?!
@PersistenceUnit
private EntityManagerFactory emf;
@PersistenceContext
private EntityManager em;
@Override
public Klant tryRegistreren(String naam, String email, String wachtwoord) {
try {
emf = Persistence.createEntityManagerFactory("RD_TravelshopPU");
RequestDispatcher rd = null;
em = emf.createEntityManager();
Klant klant = new Klant();
klant.setNaam(naam);
klant.setEmail(email);
klant.setWachtwoord(wachtwoord);
em.getTransaction().begin();
em.persist(klant);
em.getTransaction().commit();
} catch (NoResultException e) {
return null;
}
}