applicationContext.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-34.1.xsd">
<bean id="showSpeak1" class="com.oupeng.speak.Speak">
<property name="speakPerson">
<value>张嘎</value>
</property>
<property name="speakContent">
<value>三天不打小鬼子,手都痒痒!</value>
</property>
</bean>
<bean id="showSpeak2" class="com.oupeng.speak.Speak">
<property name="speakPerson">
<value>Rod</value>
</property>
<property name="speakContent">
<value>世界上有10种人,认识二进制的和不认识二进制的。</value>
</property>
</bean>
</beans>
Speak类
package com.oupeng.speak;
public class Speak {
private String speakPerson;
private String speakContent;//说话内容
public void showSpeak(){
System.out.println(this.speakPerson+"说:“"+this.speakContent+"”");
}
public String getSpeakPerson()