springframe中的petstore中的setServlet()什麼時候呼叫

twfx發表於2005-02-23
springframework 自帶的例子jpetstore中的BaseAction類
public abstract class BaseAction extends Action {

private PetStoreFacade petStore;

public void setServlet(ActionServlet actionServlet) {
super.setServlet(actionServlet);
ServletContext servletContext = actionServlet.getServletContext();
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
this.petStore = (PetStoreFacade) wac.getBean("petStore");
}

protected PetStoreFacade getPetStore() {
return petStore;
}

}
中的setServlet()方法什麼時候呼叫的啊?

相關文章