67,550
社区成员




Interface AService{
void sayA();
}
Class A implements AService{
void sayA(){
System.out.println("A");
}
public class LoginAction extends Action {
private AService aService;
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
aService.sayA();
return null;
}
public void setAService(AService aService) {
this.aService = aService;
}
}
<bean id="a" class="A">
</bean>
<bean id="loginAction" class="LoginAction">
<property name="aService" ref="a"/>
</bean>