日期:2014-05-19  浏览次数:20696 次

applicationContext.xml配置问题。
这那里有错。求个有耐心的人给解答下。谢谢
applicationContext.xml
<bean id="gtdao" class="com.jwlc.Dao.Impl.GoodsTypeDaoImpl">
        <property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="gtbiz" class="com.jwlc.Biz.Impl.GoodsTypeBizImpl">
<property name="gtDao" ref="gtdao"></property>
</bean>
<bean name="/zhaobiao" class="com.jwlc.Action.GoodsTypeAction">
<property name="biz" ref="gtbiz"></property>
</bean>


注:
private GoodsTypeBiz gtbiz;      //action包

public void setBiz(GoodsTypeBiz gtbiz) {
this.gtbiz = gtbiz;
      }

public GoodsTypeDao gtdao;      //diz包

public void setGtDao(GoodsTypeDao gtDao) {
this.gtdao = gtdao;
}
------最佳解决方案--------------------
什么错啊,就看这个很蛋疼!
------其他解决方案--------------------
<bean id="gtbiz" class="com.jwlc.Biz.Impl.GoodsTypeBizImpl">
<property name="gtDao" ref="gtdao"></property>
</bean>
是不是要添加sessionfactory属性
------其他解决方案--------------------
<bean name="/zhaobiao" class="com.jwlc.Action.GoodsTypeAction">
 <property name="biz" ref="gtbiz"></property>
 </bean>

是ID
------其他解决方案--------------------
嗯嗯,是id,唯一标识注入的对象。