|
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;
}
|
本站文章版權(quán)歸原作者及原出處所有 。內(nèi)容為作者個人觀點, 并不代表本站贊同其觀點和對其真實性負責(zé),本站只提供參考并不構(gòu)成任何投資及應(yīng)用建議。本站是一個個人學(xué)習(xí)交流的平臺,網(wǎng)站上部分文章為轉(zhuǎn)載,并不用于任何商業(yè)目的,我們已經(jīng)盡可能的對作者和來源進行了通告,但是能力有限或疏忽,造成漏登,請及時聯(lián)系我們,我們將根據(jù)著作權(quán)人的要求,立即更正或者刪除有關(guān)內(nèi)容。本站擁有對此聲明的最終解釋權(quán)。