struts2架构中核心对象的探索—— ActionContextClearUp
来源:互联网 发布:大数据 涂子沛 下载 编辑:程序博客网 时间:2024/05/17 07:56
ActionContextClearUp其实是Defer ClearUP.作用就是延长action中属性的生命周期,包括自定义属性,以便在jsp页面中进行访问,让actionContextcleanup过滤器来清除属性,不让action自己清除。
具体看下面的代码,代码很简单
public void doFilter(...){ ... try{ ... //继续执行所配置的chain中的Filter chain.doFilter(request, response); }finally{ //保证在所有动作执行完之后,调用cleanUp ... cleanUp(request); } } protected static void cleanUp(ServletRequest req) { ... ActionContext.setContext(null);//清除ActionContext实例 Dispatcher.setInstance(null);//清除Dispatcher实例(Dispatcher主要是完成将url解析成对应的Action) }
另外注明一下UtilTimerStack的push和pop是用来计算调用方法所执行的开始和结束时间,用来做性能测试的。用法如下:
String timerKey = "ActionContextCleanUp_doFilter: "; UtilTimerStack.setActive(true); UtilTimerStack.push(timerKey); //调用要测试的方法。 UtilTimerStack.pop(timerKey);
阅读全文
0 0
- struts2架构中核心对象的探索—— ActionContextClearUp
- struts2架构中核心对象的探索—— ActionContext和ServletActionContext
- struts2架构中核心对象的探索—— Dispatcher&ConfigurationProvider
- Struts2 ActionContextClearUp详解
- struts2中Ajax的操作实现及其核心对象XMLHttpRequest对象的使用
- Scrapy研究探索(三)——Scrapy核心架构与代码运行分析
- Scrapy研究探索(三)——Scrapy核心架构与代码运行分析
- 《研磨struts2》第三章 Struts2的架构和运行流程 之 3.3 Struts2的核心概念
- Hibernate学习笔记(二) — 探索 hibernate 中对象的状态
- Ajax的核心——XMLHttpRequest 对象
- struts2中对象的获取
- Struts2的架构和运行流程 之 3.3 Struts2的核心概念
- 第三章 Struts2的架构和运行流程 之 3.3 Struts2的核心概
- Struts2 的核心——拦截器[Interceptor]
- struts2中action之间使用chain传值的探索
- struts2中action之间使用chain传值的探索
- JFreeChart中几个核心的对象类
- JFreeChart中几个核心的对象类
- java互联网架构-Mybatis缓存机制
- 解决struts2以GET方式提交表单中文乱码问题
- 第二周 项目3 汉诺塔程序
- leetcode 200. Number of Islands DFS深度优先遍历
- Android JNI开发(3)--引用类型
- struts2架构中核心对象的探索—— ActionContextClearUp
- 数据库中Any和All区别
- hexo建站详解----jade 。swig。ejs模板使用 hexo favicon设置
- Websocket(一)简单的demo实现
- Caused by:Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
- swiper 定位到指定页面或位置
- Nginx学习总结(10)——Nginx前后端分离将多个请求转发到多个Tomcat,负载均衡反向代理
- SQL注入思路与手工猜解
- spring 更换数据库