zael
V2EX  ›  问与答

undertow 容器里怎么获取 request/response?

  •  
  •   zael · Apr 12, 2019 · 1964 views
    This topic created in 2709 days ago, the information mentioned may be changed or developed.

    官网上给的 demo 里 req,resp 两个对象都被封装进了 HttpServerExchange 对象里,用起来很不习惯

    我用下面这种方法获取的对象是 null

    ServletRequestContext attachment = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
    

    请问怎么获取 servlet 规范里的 HttpServletRequest,HttpServletResponse 对象呢?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   946 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:40 · PVG 06:40 · LAX 15:40 · JFK 18:40
    ♥ Do have faith in what you're doing.