感谢ITCAST发布的免费视频。
public class PersonServiceBean implements PersonService {
private PersonDao personDao;
private String name;
public void save() {
}
public PersonServiceBean(PersonDao personDao, String name) {
super();
this.personDao = personDao;
this.name = name;
}
}
配置文件:
<bean id="personService" class="service.impl.PersonServiceBean" init-method="init" destroy-method="destory">
<constructor-arg index="0" type="PersonDao" ref="personDao">
</constructor-arg>
<constructor-arg index="1" type="java.lang.String" value="str">
</constructor-arg>
</bean>