[[toc]]
<bean id="helloService" class="io.spring.hello.HelloServiceImpl" />
<!-- helloPrinter bean定义 -->
<bean id="helloPrinter" class="io.spring.hello.HelloPrinter">
<constructor-arg ref="helloService" />
<constructor-arg value="aaa"/>
<constructor-arg value="bbb"/>
<constructor-arg value="123"/>
</bean>
// HelloPrinter java类定义
public class HelloPrinter {
private HelloService helloService;
public HelloPrinter(HelloService helloService, String s1, String s2, int id) {
this.helloService = helloService;
System.out.println(s1 + s2 + id);
}
public void print() {
System.out.println(helloService.sayHello());
}
}
<!-- helloPrinter bean定义 -->
<bean id="helloPrinter" class="io.spring.hello.HelloPrinter">
<property name