标准的spring配置文件
来源:互联网 发布:淘宝导航css代码模板 编辑:程序博客网 时间:2024/05/23 07:24
<?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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
default-autowire="byName" default-lazy-init="true">
<!-- 配置数据源 -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>
jdbc:mysql://localhost/ssh?characterEncoding=utf-8
</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>123</value>
</property>
</bean>
<!--配置SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="mappingResources">
<list>
<value>com/ssh/pojo/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!-- 事务管理 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- hibernateTemplate -->
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- 配置数据持久层 -->
<bean id="userDao"
class="com.ssh.dao.impl.UserDaoImpl">
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<!-- 配置业务逻辑层 -->
<bean id="userService"
class="com.ssh.service.impl.UserServiceImpl">
<property name="userDao" ref="userDao"></property>
</bean>
<!-- 配置控制层 -->
<bean id="UserAction"
class="com.ssh.action.UserAction" scope="prototype">
<property name="userService" ref="userService"></property>
</bean>
<!-- 配置pojo -->
<bean id="User" class="com.ssh.pojo.User" scope="prototype"/>
</beans>
- 标准的Spring配置文件
- 标准的spring配置文件
- 标准的Spring配置文件编写:
- struts+hibernate+spring标准配置文件
- spring的配置文件
- 详解Spring的配置文件
- 详解Spring的配置文件
- 详解Spring的配置文件
- 详解Spring的配置文件
- spring的XML配置文件
- Spring 配置文件的差异
- 详解Spring的配置文件
- 详解Spring的配置文件
- Spring的配置文件实例
- 详解Spring的配置文件
- Spring配置文件的测试
- spring的配置文件总结
- 详解Spring的配置文件
- 实现图标抖动
- Java环境变量配置
- (原创)JAVA读取硬件信息(MAC地址,CPU号,硬盘卷标,CPU型号及CPU使用率等信息)
- IEC(IE表单拦截器)的实现原理--屌死也来玩逆袭
- POJ 2586
- 标准的spring配置文件
- linux设备驱动归纳总结(八):4.总线热插拔
- 应用之星破除行业门槛 零成本开发手机应用
- 人生无根蒂,飘如陌上尘.
- MongoDB非正常关闭后无法启动
- BZOJ 2705([SDOI2012]Longge的问题-欧拉函数φ(i))
- android 根据Uri获取文件绝对路径
- 在程序块__block里面使用方法转换
- Ubuntu服务器绑定固定IP地址