ActionContext与ServletActionContext的区别

来源:互联网 发布:php namespace 编辑:程序博客网 时间:2024/06/11 01:42


  • ActionContext
    xwork框架的ActionContext是Action执行时的上下文,存放Action执行时需要用到的对象。在使用webwork时,其中放有Parameter、Session、ServletContext、Locale等信息。这样,webwork负责将Servlet相关数据转换为与ServletAPI无关的Map对象(即ActionContext),使得xwork的Action实现与web层、逻辑层与表现层的解耦。
  • ServletActionContext
    提供直接与Servlet容器交互的途径。通过它,可以取得HttpServletRequest、HttpServletResponse 、ServletConfig、ServletContext、PageContext 对象。但是,使用ServletActionContext意味着Action与ServletAPI的紧密耦合。

原创粉丝点击