<bean id="simpleTree" class="com.xxx.web.tree.SimpleTree">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean> <bean id="simpleTreeTag" class="com.xxx.web.taglib.view.SimpleTreeTag" >
<property name="tree">
<ref local="simpleTree"/>
</property>
<property name="simpleTree">
<ref local="simpleTree"/>
</property>
</bean>
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean> <bean id="simpleTreeTag" class="com.xxx.web.taglib.view.SimpleTreeTag" >
<property name="tree">
<ref local="simpleTree"/>
</property>
<property name="simpleTree">
<ref local="simpleTree"/>
</property>
</bean>
对你程序的架构不了解,不过感觉应该如下:
Action --> 逻辑(事务)处理层(调用了SimpleTree) --> DAO,由于在逻辑处理层包含有事务和DB的映射关系
SimpleTree --> DAO,无事务和DB的映射关系,所以直接获取getHibernateTemplate()是得不到的