zael
V2EX  ›  问与答

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

  •  
  •   zael · Apr 12, 2019 · 1787 views
    This topic created in 2591 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   ·   Solana   ·   2952 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 05:30 · PVG 13:30 · LAX 22:30 · JFK 01:30
    ♥ Do have faith in what you're doing.