<? 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/beans
Http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Http://www.springframework.org/schema/context
Http://www.springframework.org/schema/context/spring-context-2.5.xsd
Http://www.springframework.org/schema/tx
Http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
Default-autowire = "byname" default-Lazy-init = "true">
<! -- Configure the data source -->
<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>
<! -- Configure 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>
<! -- Transaction Management -->
<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>
<! -- Configure the data persistence layer -->
<Bean id = "userdao"
Class = "com. Ssh. Dao. impl. userdaoimpl">
<Property name = "hibernatetemplate" ref = "hibernatetemplate"> </property>
</Bean>
<! -- Configure the business logic layer -->
<Bean id = "userservice"
Class = "com. Ssh. Service. impl. userserviceimpl">
<Property name = "userdao" ref = "userdao"> </property>
</Bean>
class = "com. ssh. action. useraction "Scope =" prototype ">