action session request response 对象的获取

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.SessionAware;
import org.apache.struts2.interceptor.ServletRequestAware;

public abstract class BaseAction extends ActionSupport implements Action, SessionAware, ServletRequestAware {

public HttpServletRequest request;

public void setServletRequest(HttpServletRequest request) {
     this.request=request;
}

public HttpServletRequest getRequest() {
return this.request;
}



public Map session;

public void setSession(Map session) {
this.session = session;
}

public HttpSession getSession() {
//HttpServletRequest request = ServletActionContext.getRequest();
return this.request.getSession();
}

你可能感兴趣的:(response)