zoukankan      html  css  js  c++  java
  • tomcat源码阅读_代码篇12

    valve的invoke方法:

    void invoke(Request request,
                Response response)
                throws java.io.IOException,
                       javax.servlet.ServletException

    阀门通过该方法来处理请求,可以有如下顺序执行:

  • 检查或者修改特定的Request和Response的属性
  • 检查Request的属性,并产生相应的Response,并返回其控制权给调用者。
  • 检查Request和Response的属性,将其包装到相应对象中,并传递他们。
  • 如果没有产生抑制的Response对象,调用管道中的下一个阀门,getNext().invoke()
  • 检查但是不修改Response的属性。
  • 阀门不能做如下事情:

  • Change request properties that have already been used to direct the flow of processing control for this request (for instance, trying to change the virtual host to which a Request should be sent from a pipeline attached to a Host or Context in the standard implementation).
  • Create a completed Response AND pass this Request and Response on to the next Valve in the pipeline.
  • Consume bytes from the input stream associated with the Request, unless it is completely generating the response, or wrapping the request before passing it on.
  • Modify the HTTP headers included with the Response after the getNext().invoke() method has returned.
  • Perform any actions on the output stream associated with the specified Response after the getNext().invoke() method has returned
查看全文
  • 相关阅读:
    BZOJ_2802_[Poi2012]Warehouse Store_堆+贪心
    BZOJ_1025_[SCOI2009]游戏_DP+置换+数学
    BZOJ_3672_ [Noi2014]购票_CDQ分治+斜率优化
    BZOJ_3671_[Noi2014]随机数生成器_set+贪心
    BZOJ_1998_[Hnoi2010]Fsk物品调度_并查集+置换
    BZOJ_1119_[POI2009]SLO_置换+贪心
    「JOI Open 2016」摩天大楼(笛卡尔树dp+优化)
    【GDOI2020模拟01.16】树上的鼠 (博弈+长链剖分优化dp)
    【GDOI2020模拟01.16】划愤(nim积+行列式)
    Codeforces [Hello 2020] 1284F New Year and Social Network(图论匹配推理+lct)
  • 原文地址:https://www.cnblogs.com/macula7/p/1960469.html
  • Copyright © 2011-2022 走看看