I am using JSF2+Spring3.1+Hibernate4 in my demo application and i will want to use annotation to create session factory but my DAO class is not initialize in Jsf Managed Bea
Can you try ManagedProperty annotation for UserDAO
@ManagedProperty("#{userDAO}") private UserDAO userDAO; private void setUserDAO(UserDAO userDAO){ this.userDAO=userDAO; }
You may need to change dao annotation as well
@Repository("userDAO") @Transactional public class UserDAO