ApplicationContext.xml
Spring使用方法
<?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:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<bean id="hello1" class="com.yao.Pojo.hello">
<property name="name" value="yzb"/>
<property name="number" value="15327454472"/>
<constructor-arg index="0" value="ylb"/>
<constructor-arg index="1" value="15154121346"/>
</bean>
<bean id="hello2" class="com.yao.Pojo.hello">
<constructor-arg type="java.lang.String" value="ylb"/>
<constructor-arg type="java.lang.String" value="151516"/>
</bean>
<bean id="hello3" class="com.yao.Pojo.hello" p:name="ss" p:number="ss"/>
<bean id="hello4" class="com.yao.Pojo.hello" c:name="ss" c:number="ss"/>
<bean id="address" class="com.yao.Pojo.Address"/>
<bean id="Student" class="com.yao.Pojo.Student">
<property name="name" value="yzb"/>
<property name="address" ref="address"/>
<property name="books">
<array>
<value>aa</value>
<value>bb</value>
<value>cc</value>
</array>
</property>
<property name="hobby">
<list>
<value>aaa</value>
<value>bbb</value>
<value>ccc</value>
</list>
</property>
<property name="card">
<map>
<entry key="1" value="aaaa"/>
<entry key="2" value="bbbb"/>
<entry key="3" value="cccc"/>
</map>
</property>
<property name="games">
<set>
<value>sss</value>
<value>ddd</value>
</set>
</property>
<property name="wife">
<null/>
</property>
<property name="info">
<props>
<prop key="stuNO">1900130517</prop>
</props>
</property>
</bean>
<bean id="log" class="com.yao.log.log"/>
<bean id="afterLog" class="com.yao.log.AfterLog"/>
<bean id="student1" class="com.yao.Pojo.Student1"/>
<bean id="allLog" class="com.yao.log.allLog"/>
<bean id="annotationLog" class="com.yao.log.AnnotationLog"/>
<aop:aspectj-autoproxy/>
</beans>