<?
xml version=”1.0″ encoding=”UTF-8″
?>
<!
DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN” “http://www.springframework.org/dtd/spring-beans.dtd”
>
<
beans
>
<
bean
id
=”viewResolver”
class
=”org.springframework.web.servlet.view.InternalResourceViewResolver”
>
<
property
name
=”viewClass”
>
<
value
>
org.springframework.web.servlet.view.JstlView
</
value
>
</
property
>
<
property
name
=”prefix”
>
<
value
>
/admin/
</
value
>
</
property
>
<
property
name
=”suffix”
>
<
value
>
.jsp
</
value
>
</
property
>
</
bean
>
<
bean
id
=”urlMapping”
class
=”org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”
>
<
property
name
=”mappings”
>
<
props
>
<
prop
key
=”/admin/login.do”
>
LoginAction
</
prop
>
</
props
>
</
property
>
</
bean
>
<
bean
id
=”exceptionResolver”
class
=”org.springframework.web.servlet.handler.SimpleMappingExceptionResolver”
>
<
property
name
=”defaultErrorView”
>
<
value
>
failure
</
value
>
</
property
>
<
property
name
=”exceptionMappings”
>
<
props
>
<
prop
key
=”java.sql.SQLException”
>
showDBError
</
prop
>
<
prop
key
=”java.lang.RuntimeException”
>
showError
</
prop
>
</
props
>
</
property
>
</
bean
>
<
bean
id
=”dataSource”
class
=”org.apache.commons.dbcp.BasicDataSource”
destroy-method
=”close”
>
<
property
name
=”driverClassName”
>
<
value
>
org.git.mm.mysql.Driver
</
value
>
</
property
>
<
property
name
=”url”
>
<
value
>
jdbc:mysql://localhost:3306/babyonline
</
value
>
</
property
>
<
property
name
=”username”
>
<
value
>
root
</
value
>
</
property
>
<
property
name
=”password”
>
<
value
>
123456
</
value
>
</
property
>
</
bean
>
<
bean
id
=”sessionFactory”
class
=”org.springframework.orm.hibernate3.LocalSessionFactoryBean”
>
<
property
name
=”dataSource”
>
<
ref
local
=”dataSource”
/>
</
property
>
<
property
name
=”mappingResources”
>
<
list
>
<
value
></
value
>
</
list
>
</
property
>
<
property
name
=”hibernateProperties”
>
<
props
>
<
prop
key
=”hibernate.dialect”
>
org.hibernate.dialect.MySQLDialect
</
prop
>
<
prop
key
=”hibernate.show_sql”
>
true
</
prop
>
</
props
>
</
property
>
</
bean
>
<
bean
id
=”transactionManager”
class
=”org.springframework.jdbc.datasource.DataSourceTransactionManager”
>
<
property
name
=”dataSource”
>
<
ref
local
=”dataSource”
/>
</
property
>
</
bean
>
<
bean
id
=”userDAO”
class
=””
>
<
property
name
=”sessionFactory”
>
<
ref
local
=”sessionFactory”
/>
</
property
>
</
bean
>
<
bean
id
=”userDAOProxy”
class
=”org.springframework.transaction.interceptor.TransactionProxyFactoryBean”
>
<
property
name
=”transactionManager”
>
<
ref
bean
=”transactionManager”
/>
</
property
>
<
property
name
=”target”
>
<
ref
local
=”userDAO”
/>
</
property
>
<
property
name
=”transactionAttributes”
>
<
props
>
<
prop
key
=”insert*”
>
PROPAGATION_REQUIRED
</
prop
>
<
prop
key
=”get*”
>
PROPAGATION_REQUIRED,readonly
</
prop
>
</
props
>
</
property
>
</
bean
>
</
beans
>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/35981.html