SSH框架中Spring中的错误 20
<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schem...
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
<property name="mappingResources">
<list>
<value>com/newdemo/pojo/CollegeNews.hbm.xml</value>
</list>
</property>
</bean>
<!-- DAO -->
<bean id="CollegeNewsDAO" class="com.newdemo.dao.CollegeNewsDAO">
<property name="sessionFactory"><!-- 这错误了!!求解 -->
<ref local="sessionFactory" />
</property>
</bean> 展开
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
<property name="mappingResources">
<list>
<value>com/newdemo/pojo/CollegeNews.hbm.xml</value>
</list>
</property>
</bean>
<!-- DAO -->
<bean id="CollegeNewsDAO" class="com.newdemo.dao.CollegeNewsDAO">
<property name="sessionFactory"><!-- 这错误了!!求解 -->
<ref local="sessionFactory" />
</property>
</bean> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询