HttpServletRequest request=ServletActionContext.getRequest();
package app.converter;
import java.util.Collection;
import java.util.Date;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
public class UserAction extends ActionSupport {
private Integer id;
private String username;
private Date createtime;
private Education edu;
private Collection<Emp>emps;
public String save(){
System.out.println("UserAction tfy save()");
HttpServletRequest request=ServletActionContext.getRequest();
//获取web页面元素
String id=request.getParameter("id");
String usename=request.getParameter("username");
System.out.println("id=="+id);
System.out.println("username=="+username);
System.out.println("createtime=="+createtime);
System.out.println(edu.getEduid()+"=="+edu.getEduname());
return SUCCESS;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Education getEdu() {
return edu;
}
public void setEdu(Education edu) {
this.edu = edu;
}
public Collection<Emp> getEmps() {
return emps;
}
public void setEmps(Collection<Emp> emps) {
this.emps = emps;
}
}