1
2
|
< bean id = "trService" class = "com.zbrx.bzy.service.TeacherService" ></ bean >
< bean id = "cdService" class = "com.zbrx.bzy.service.ChildService" ></ bean >
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
WebApplicationContext applicationContext =
WebApplicationContextUtils.getWebApplicationContext(sc.getServletContext());
this .trService=(TeacherService)applicationContext.getBean( "trService" );
this .cdService=(ChildService)applicationContext.getBean( "cdService" );
//定义变量
private TeacherService trService;
private ChildService cdService;
public TeacherService getTrService() {
return trService;
}
public void setTrService(TeacherService trService) {
this .trService = trService;
}
public ChildService getCdService() {
return cdService;
}
public void setCdService(ChildService cdService) {
this .cdService = cdService;
}
|
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责,本站只提供参考并不构成任何投资及应用建议。本站是一个个人学习交流的平台,网站上部分文章为转载,并不用于任何商业目的,我们已经尽可能的对作者和来源进行了通告,但是能力有限或疏忽,造成漏登,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。