I made a project similar to DWRSpringJPA example, but without DWR.
I have a class StudentService, and it holds a class StudentProfileDAO.
I am finding that Spring is not instantiating the DAO class, it is null.
My relevent files:
applicationContext.xml:
<bean id=”entityManagerFactory”
class=”org.springframework.orm.jpa.LocalEntityManagerFactoryBean”>
<property name=”persistenceUnitName” value=”educationPU” />
</bean>
<bean id=”transactionManager” class=”org.springframework.orm.jpa.JpaTransactionManager”>
<property name=”entityManagerFactory” ref=”entityManagerFactory” />
</bean>
<tx:annotation-driven transaction-manager=”transactionManager” />
<bean id=”StudentProfileDAO” class=”com.jpa.StudentProfileDAO”>
<property name=”entityManagerFactory” ref=”entityManagerFactory” />
</bean>
<bean id=”studentService” class=”com.services.StudentService”>
<property name=”studentProfileDAO” ref=”StudentProfileDAO” />
</bean>
I have a jspx page that has:
<ice:inputText id=”lastName” value=”#{studentService.studentProfileDAO.lastName}”/>
and it reports back that studentProfileDAO is null.
How do I make Spring automatically instantiate the DAO when StudentService is instantiated?
Thanks