<form-beans> <!--存放用户登陆的账号信息--> <form-bean name="accountForm"type="org.springframework.samples.jpetstore.web.struts.AccountActionForm"/> <form-bean name="cartForm" type="org.springframework.samples.jpetstore.web.struts.CartActionForm"/> <form-bean name="emptyForm" type="org.springframework.samples.jpetstore.web.struts.BaseActionForm"/> <!--用于用户注册和个人资料修改时存放用户信息--> <form-bean name="workingAccountForm"type="org.springframework.samples.jpetstore.web.struts.AccountActionForm"/> <form-bean name="workingOrderForm"type="org.springframework.samples.jpetstore.web.struts.OrderActionForm"/> </form-beans>
<action path="/shop/signonForm"type="org.springframework.samples.jpetstore.web.struts.DoNothingAction" validate="false"> <forward name="success" path="/WEB-INF/jsp/struts/SignonForm.jsp"/> </action> <action path="/shop/signon"type="org.springframework.samples.jpetstore.web.struts.SignonAction" name="accountForm" scope="session" validate="false"> <forward name="success" path="/shop/index.do"/> </action>
<action path="/shop/newAccountForm"type="org.springframework.samples.jpetstore.web.struts.NewAccountFormAction" name="workingAccountForm" scope="session" validate="false"> <forward name="success" path="/WEB-INF/jsp/struts/NewAccountForm.jsp"/> </action>
<action path="/shop/newAccount"type="org.springframework.samples.jpetstore.web.struts.NewAccountAction" name="workingAccountForm" scope="session"validate="true" input="/WEB-INF/jsp/struts/NewAccountForm.jsp"> <forward name="success" path="/shop/index.do"/> </action>
<action path="/shop/editAccountForm" type="org.springframework.samples.jpetstore.web.struts.EditAccountFormAction" name="workingAccountForm" scope="session" validate="false"> <forward name="success" path="/WEB-INF/jsp/struts/EditAccountForm.jsp"/> </action> <action path="/shop/editAccount" type="org.springframework.samples.jpetstore.web.struts.EditAccountAction" name="workingAccountForm" scope="session" validate="true" input="/WEB-INF/jsp/struts/EditAccountForm.jsp"> <forward name="success" path="/shop/index.do"/> </action>
public void setServlet(ActionServlet actionServlet) { super.setServlet(actionServlet); if (actionServlet != null) { ServletContext servletContext = actionServlet.getServletContext(); WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); this.petStore = (PetStoreFacade) wac.getBean("petStore"); }
很好的和spring衔接在了一起,获得了系统的业务逻辑对象 。
| 第1页: 第1页 |