日期:2014-05-20 浏览次数:20809 次
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5"> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB_INF/struts-config.xml</param-value> </init-param> <load-on-start>0</load-on-start> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> </web-app>
<?xml version="1.0" encoding="UTF-8"?> <struts-config> <form-beans > <form-bean name="loginForm" type="cn.itcast.LoginForm"></form-bean> <form-bean name="addStudentForm" type="cn.itcast.AddStudentForm"></form-bean> </form-beans> <action-mappings> <action path="/login" type="cn.itcast.LoginAction" name="loginForm"> <!-- name指定中心控制器带的东西,可以没有Form不会报错,但之后就不能使用path--> <forward name="loginSuccess" path="/loginSuccess.jsp"></forward> <forward name="loginFailure" path="/loginFailure.jsp"></forward> </action> </action-mappings> </struts-config>