Skip to content

Commit 008ae90

Browse files
author
chenhaoxiang
committed
【框架】[Spring3]下载安装、开源框架与IoC控制反转详解
1 parent 8dcb6d1 commit 008ae90

40 files changed

Lines changed: 1995 additions & 0 deletions

‎Spring/README.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
这里是Spring框架的相关文档、项目、JAR包等
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+

‎Spring/mySpring3Demo/.classpath‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_04"/>
5+
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
6+
<classpathentry kind="lib" path="lib/org.springframework.asm-3.1.1.RELEASE.jar"/>
7+
<classpathentry kind="lib" path="lib/org.springframework.beans-3.1.1.RELEASE.jar"/>
8+
<classpathentry kind="lib" path="lib/org.springframework.context-3.1.1.RELEASE.jar"/>
9+
<classpathentry kind="lib" path="lib/org.springframework.context.support-3.1.1.RELEASE.jar"/>
10+
<classpathentry kind="lib" path="lib/org.springframework.core-3.1.1.RELEASE.jar"/>
11+
<classpathentry kind="lib" path="lib/org.springframework.expression-3.1.1.RELEASE.jar"/>
12+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
13+
<classpathentry kind="output" path="bin"/>
14+
</classpath>

‎Spring/mySpring3Demo/.project‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>mySpring3Demo</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Wed Aug 31 13:07:54 CST 2016
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.6
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.6

‎Spring/mySpring3Demo/README.md‎

Lines changed: 728 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:context="http://www.springframework.org/schema/context"
5+
xmlns:tx="http://www.springframework.org/schema/tx"
6+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
7+
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
8+
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
9+
10+
<!--scope属性值设为:prototype(每次获取都是一个新对象), request(同一个request中获取到的是同一个), session ,不设置,默认是单例 -->
11+
<bean id="p" class="cn.hncu.demo1.domain.Person">
12+
<!-- 配置好初始值 -->
13+
<property name="name" value="张三"></property>
14+
<property name="age" value="23"></property>
15+
</bean>
16+
17+
<!-- 注意这里的class是实现类,而不是接口哦 -->
18+
<!-- 如果换实现类了,只需把这里的class变了就可以了,或者不动这里,增加一个bean -->
19+
<bean id="dao" class="cn.hncu.demo1.login.dao.LoginDaoJdbc2">
20+
</bean>
21+
22+
<!-- 注意这里的class也是实现类,而不是接口哦 -->
23+
<bean id="s" class="cn.hncu.demo1.login.service.LoginServiceImpl">
24+
<!-- 实现类中还有变量,ref是另外的bean的id-引用 -->
25+
<property name="dao" ref="dao"></property>
26+
</bean>
27+
28+
<bean id="login" class="cn.hncu.demo1.login.LoginAction">
29+
<property name="service" ref="s"></property>
30+
<property name="person" ref="p"></property>
31+
</bean>
32+
33+
34+
35+
36+
</beans>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:context="http://www.springframework.org/schema/context"
5+
xmlns:tx="http://www.springframework.org/schema/tx"
6+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
7+
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
8+
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
9+
10+
11+
<bean id="cat" class="cn.hncu.demo2.domain.Cat">
12+
<!-- 初始化name -->
13+
<property name="name" value="黑猫"></property>
14+
</bean>
15+
16+
<bean id="user" class="cn.hncu.demo2.domain.User">
17+
<property name="name" value="Jack"></property>
18+
<property name="age" value="25"></property>
19+
20+
<property name="pets">
21+
<list>
22+
<value>cat</value>
23+
<value>dog</value>
24+
<value>tiger</value>
25+
</list>
26+
</property>
27+
28+
<property name="map">
29+
<map>
30+
<entry key="name" value="中国"></entry>
31+
<entry key="age" value="67"></entry>
32+
<!-- ref是引用 -->
33+
<entry key="cat" value-ref="cat"></entry>
34+
</map>
35+
</property>
36+
<property name="set">
37+
<set>
38+
<!-- 引用 -->
39+
<ref bean="cat"/>
40+
<value>aaa</value>
41+
<value>bbb</value>
42+
</set>
43+
</property>
44+
<property name="objs">
45+
<!-- 数组 -->
46+
<array>
47+
<value>hrllo</value>
48+
<ref bean="cat"/>
49+
<list>
50+
<value>obj1</value>
51+
<value>obj2</value>
52+
</list>
53+
<bean class="cn.hncu.demo2.domain.Cat">
54+
<property name="name" value="白猫"></property>
55+
</bean>
56+
</array>
57+
</property>
58+
</bean>
59+
</beans>
1.27 KB
Binary file not shown.
1.16 KB
Binary file not shown.
1.07 KB
Binary file not shown.

0 commit comments

Comments
 (0)