当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
获取Servlet对象
发布时间:2010/9/10 10:12:45 来源:城市学习网 编辑:ziteng
  Java代码
  //模拟HttpSession
  Map<String,Object> session=ActionContext.getContext().getSession();
  //模拟Application
  Map<String,Object> application=ActionContext.getContext().getApplication();
  //取得HttpServletRequest
  HttpServletRequest request=ServletActionContext.getRequest();
  //取得HttpServletResponse
  HttpServletResponse response=ServletActionContext.getResponse();
  //取得PageContext
  PageContext pageContext=ServletActionContext.getPageContext();
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved