注册页面
接受注册页面提交的参数。 Servlet JSP Struts 2 (WebWork)---->Action
Struts 1 –> ActionForm --->Action
struts 2 开发步骤
1:拷贝 5 个 JAR 包
2:修改 web.xml 文件 在该文件中添加一个过滤器
org.apache.struts2.dispatcher.FilterDispatcher 中央控制器 核心控制器
RegisterAction 首先需要封装参数,需要有和参数相对应的属性以及方法。
package com.ibeifeng.action;
import com.opensymphony.xwork2.ActionSupport;
public class Register extends ActionSupport{
private String username;
private String password;
private String repassword;
private String nickname;
private String question;
private String answer;
public String getUsername() {
return username;
}
注
册
页
面
FilterDispatcher
RegisterAction
struts.xml
评论0