日期:2014-05-17 浏览次数:20721 次
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <!-- 数据源配置 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/supplysystem" /> <property name="username" value="root" /> <property name="password" value="chen" /> <property name="initialSize" value="5" /> <property name="maxActive" value="10" /> </bean> <!-- Hibernate框架整合配置 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="annotatedClasses"> <list> <value>com.neusoft.vo.Admin</value> <value>com.neusoft.vo.AdminRight</value> <value>com.neusoft.vo.Depot</value> <value>com.neusoft.vo.Product</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <!-- 以下是对DAO目标对象的配置 --> <bean id="adminDao" class="com.neusoft.dao.imp.AdminDaoImp"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <!-- 以下是对service的配置 --> <bean id="adminService" class="com.neusoft.service.imp.AdminServiceImp"> <property name="adminDao" ref="adminDao"/> </bean> <!-- 以下是对Struts中Action类的配置 --> <bean name="/loginAction" class="com.neusoft.web.action.LoginAction"> <property name="loginService" ref="loginService"></property> </bean> <!-- 以下是对DAO对象的配置 --> <bean id="checkDao" class="com.neusoft.dao.imp.CheckDaoImp"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="deliverDao" class="com.neusoft.dao.imp.DeliverDaoImp"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- 以下是对Struts中Action类的配置 --> <bean name="/check" class="com.neusoft.web.action.ViewTaskAction"> <property name="checkService" ref="checkService"/> <property name="adminService" ref="adminService"/> </bean> <!-- 以下是对DAO目标对象的配置 --> <bean id="allocateDao" class="com