首页>代码>s2sh(struts2+spring+hibernate)框架搭建人力资源网站后台管理系统>/chen-hrms/src/main/java/com/hrms/action/BaseAction.java
package com.hrms.action;

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

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.opensymphony.xwork2.ActionSupport;

@Component("baseAction")
@Scope("prototype")
public class BaseAction extends ActionSupport {
	private static final long serialVersionUID = 846173940066330369L;
	protected HttpServletRequest request;
	public HttpServletRequest getRequest() {
		return ServletActionContext.getRequest();
	}

	/**
	 *
	 * 
	 * @return
	 */
	public HttpServletResponse getResponse() {
		return ServletActionContext.getResponse();
	}

	/**
	 *
	 * 
	 * @return
	 */
	public HttpSession getSession() {
		return getRequest().getSession();
	}

	/**
	 *
	 * 
	 * @return
	 */
	public ServletContext getServletContext() {
		return ServletActionContext.getServletContext();
	}

	public String getRealyPath(String path) {
		return getServletContext().getRealPath(path);
	}
	
}
最近下载更多
AOAO1234  LV2 2024年12月24日
sunlea  LV20 2024年5月17日
BruceQ  LV14 2023年5月10日
chentianqi  LV5 2023年3月27日
lcqlcl  LV11 2023年3月27日
sweetbox  LV10 2023年2月27日
sweetlove  LV20 2022年11月28日
yuanjuntao  LV5 2022年7月5日
Hugo_0901  LV5 2022年4月27日
wanglinddad  LV55 2022年3月1日
最近浏览更多
AOAO1234  LV2 2024年12月24日
微信网友_7290593889931264 2024年12月10日
暂无贡献等级
xs13883100  LV1 2024年5月15日
sunlea  LV20 2024年5月9日
hmf1989 2024年4月29日
暂无贡献等级
123456wadff  LV3 2024年1月15日
WBelong  LV8 2023年12月27日
3501855841 2023年12月22日
暂无贡献等级
dsadasdwf  LV12 2023年10月23日
haotzy  LV3 2023年10月8日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友