zael
V2EX  ›  问与答

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

  •  
  •   zael · Apr 12, 2019 · 1788 views
    This topic created in 2592 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   ·   3050 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 15:10 · PVG 23:10 · LAX 08:10 · JFK 11:10
    ♥ Do have faith in what you're doing.