今晚完成了余老师安排的作业,在我的订餐系统中,架设Struts2的框架,并进行简单的页面跳转。完成了登陆页面的跳转,但不包括用户名密码的验证。
struts.xml
<action name="login_*" class="Com.CisoftDinner.Login" method="{1}">
<result>
/test.jsp
</result>
<result name="act">
manage/dinnerList2.jsp
</result>
</action>
JSP:
<form action="login_act"></form>
Class:
package Com.CisoftDinner;
import com.opensymphony.xwork2.ActionSupport;
public class Login extends ActionSupport{
public String act() throws Exception{
System.out.println("act");
return "act";
}
}
转载于:https://blog.51cto.com/ck9750/1154590