zoukankan      html  css  js  c++  java
  • strutr2运行流程

    1. 请求发送给 StrutsPrepareAndExecuteFilter

    2. StrutsPrepareAndExecuteFilter 询问 ActionMapper: 该请求是否是一个 Struts2 请求(即是否返回一个非空的 ActionMapping 对象)

    3. 若 ActionMapper 认为该请求是一个 Struts2 请求,则 StrutsPrepareAndExecuteFilter 把请求的处理交给 ActionProxy

    4. ActionProxy 通过 Configuration Manager 询问框架的配置文件,确定需要调用的 Action 类及 Action 方法

    5. ActionProxy 创建一个 ActionInvocation 的实例,并进行初始化,之后调用ActionInvocation的Invocation方法,在方法中,对Intercepter.hasNext()进行判断,若有Intercepter,则调Intercepter的intecepor()方法,之后再调其中的 invocation.invoke()返回。

    6. ActionInvocation 实例在调用Action的过程前后,涉及到相关拦截器(Intercepter)的调用。

    7. Action 执行完毕,ActionInvocation 负责根据 struts.xml 中的配置找到对应的返回结果。调用结果的 execute 方法,渲染结果。在渲染的过程中可以使用Struts2 框架中的标签。

    8. 执行各个拦截器 invocation.invoke() 之后的代码

     

    9. 把结果发送到客户端

  • 相关阅读:
    内功心法-代理模式
    java.lang.NumberFormatException: multiple points
    MarkDown语法-使用博客园的markDown编辑
    MarkDown语法
    linux下安装tomcat——service tomcat does not support chkconfig
    关于git&github的操作
    activeMQ 本地测试
    spring AOP 的坑~
    js高级面试题
    js的内存管理
  • 原文地址:https://www.cnblogs.com/yunger/p/5797997.html
Copyright © 2011-2022 走看看