ssh框架中this.getHibernateTemplate()方法的返回值是空的!不明白那里错了!
<beans<beanid="sessionFactory"class="org.springframework.orm.hibernate3.LocalSessionF...
<beans
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="htm" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:advice id="txa" transaction-manager="htm">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut expression="execution(* org.java.biz.impl.*.*(..))" id="aopp"/>
<aop:advisor advice-ref="txa" pointcut-ref="aopp"/>
</aop:config>
<bean id="studentDAO" class="org.java.dao.impl.StudentDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="studentBIZ" class="org.java.biz.impl.StudentBIZImpl">
<property name="studentDAO" ref="studentDAO"></property>
</bean>
<bean id="studentAction" class="org.java.acton.StudentAction">
<property name="studentBIZ" ref="studentBIZ"></property>
</bean>
</beans> 展开
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="htm" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:advice id="txa" transaction-manager="htm">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut expression="execution(* org.java.biz.impl.*.*(..))" id="aopp"/>
<aop:advisor advice-ref="txa" pointcut-ref="aopp"/>
</aop:config>
<bean id="studentDAO" class="org.java.dao.impl.StudentDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="studentBIZ" class="org.java.biz.impl.StudentBIZImpl">
<property name="studentDAO" ref="studentDAO"></property>
</bean>
<bean id="studentAction" class="org.java.acton.StudentAction">
<property name="studentBIZ" ref="studentBIZ"></property>
</bean>
</beans> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询