读书人

applicationContext.xml配置有关问题

发布时间: 2012-12-21 12:03:49 作者: rapoo

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,唯一标识注入的对象。

读书人网 >J2EE开发

热点推荐