首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > 云计算 >

HttpServletRequest request=ServletActionContext.getRequest()

2013-02-24 
HttpServletRequest requestServletActionContext.getRequest()package app.converterimport java.util

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;
}



}

热点排行