-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplicationContext.xml
More file actions
91 lines (72 loc) · 3.62 KB
/
Copy pathapplicationContext.xml
File metadata and controls
91 lines (72 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0" encoding="GBK"?>
<!-- Spring配置文件的根元素,使用spring-beans-3.0.xsd语义约束 -->
<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:aop="http://www.springframework.org/schema/aop" 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/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<context:annotation-config />
<!-- 启动@AspectJ支持
<aop:aspectj-autoproxy />
-->
<!-- 读取jdbc.properties配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties" />
<!-- 配置数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${driverClassName}" />
<property name="url" value="${url}" />
<property name="username" value="${username}" />
<property name="password" value="${password}" />
<!-- 连接池启动时的初始值 -->
<property name="initialSize" value="${initialSize}" />
<!-- 连接池的最大值 -->
<property name="maxActive" value="${maxActive}" />
<!-- 最大空闲值.当经过一个高峰时间后,连接池可以慢慢将已经用不到的连接慢慢释放一部分,一直减少到maxIdle为止 -->
<property name="maxIdle" value="${maxIdle}" />
<!-- 最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请 -->
<property name="minIdle" value="${minIdle}" />
</bean>
<!-- model -->
<bean id="person" class="com.wwb.entity.Person">
</bean>
<bean id="conn" class="com.wwb.dao.MysqlConn">
<property name="dataSource" ref="dataSource"></property>
</bean>
<bean id="personDAO" class="com.wwb.dao.PersonDAOImpl">
<property name="conn" ref="conn"></property>
</bean>
<bean id="myService" class="com.wwb.service.MyServiceImpl">
<property name="personDAO" ref="personDAO"></property>
</bean>
<!-- model2 -->
<bean id="things" class="com.wwb.entity.Things">
</bean>
<bean id="ThingsDAO" class="com.wwb.dao.ThingsDaoImpl">
<property name="conn" ref="conn"></property>
</bean>
<bean id="myServiceThings" class="com.wwb.service.MyServiceThingsImpl">
<property name="ThingsDAO" ref="ThingsDAO"></property>
</bean>
<!-- controller -->
<bean id="loginAction" class="com.wwb.action.LoginAction"
scope="prototype">
<property name="ms" ref="myService"></property>
<property name="user" ref="person"></property>
</bean>
<bean id="UsermanageAction" class="com.wwb.action.UserManageAction" scope="prototype" >
<property name="ms" ref="myService"></property>
</bean>
<bean id="ThingsmanageAction" class="com.wwb.action.ThingsManageAction" scope="prototype" >
<property name="ms" ref="myServiceThings"></property>
</bean>
<!--
<aop:config> <aop:aspect id="springAdviceAspect" ref="mySpringAdvice">
<aop:after-returning method="makeLog" pointcut="execution(*
com.b510.service.impl.*.*(..))" returning="pjp" /> </aop:aspect>
</aop:config>
-->
</beans>