使用ServletActionContext类直接访问Servlet API
来源:互联网 发布:重庆网络推广工作室 编辑:程序博客网 时间:2024/06/03 18:36
使用ServletActionContext类直接访问Servlet API
Struts2提供了借助ServletActionContext类访问Servlet API。ServletActionContext中的方法是静态的方法
访问Servlet API的方法主要有如下几个:
static HttpServletRequest getRequest() 用于访问Web应用的HttpServletRequest对象
static HttpServletResponse getReqponse() 用于访问Web应用的HttpServletResponse对象
例如,我们可以这样子写:
ServletActionContext.getRequest().setAttribute("success", "walking in the sun");
1 0
- 使用ServletActionContext类直接访问Servlet API
- Struts2(6):使用ServletActionContext访问Servlet API
- struts 访问servlet api (ServletActionContext 方式)
- 实现xxxAware接口直接访问Servlet API
- 实现ServletRequestAware接口直接访问Servlet API
- Servlet API的直接与间接访问
- Action间接、直接访问Servlet API
- 实现xxxAware接口直接访问Servlet API
- 使用ActionContext类访问Servlet API
- 使用ActionContext类访问Servlet API
- ActionContext和ServletActionContext区别以及action访问servlet API的三种方法
- ActionContext和ServletActionContext区别以及action访问servlet API的三种方法
- ActionContext和ServletActionContext区别以及action访问servlet API的三种方法
- ActionContext和ServletActionContext区别以及action访问servlet API的三种方法
- Struts2中访问Servlet中的API(ActionContext,ServletActionContext)两种方式
- Struts2直接访问Servlet API(IoC--不推荐使用,非IoC---推荐使用)
- ACtion直接访问Servlet API中的ServletRequest对象
- 使用IoC方法访问Servlet API
- struts2.0中struts.xml配置文件
- HDU 2602 Bone Collector
- 多国语言strings.xml与excel表格互相转换
- HDU 2191
- python read 二进制文件
- 使用ServletActionContext类直接访问Servlet API
- 113道C语言题目
- POJ 1028 用栈模拟浏览器的前进与后退
- 无线安全后记
- 递归--放苹果
- 递归--整数划分问题
- WV梦幻之旅国际俱乐部 --WV梦幻之旅奖金制度剖析
- java基础——多态
- 小记 一