V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
tomoya92
V2EX  ›  问与答

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

  •  
  •   tomoya92 · 2019-04-12 15:29:36 +08:00 · 1446 次点击
    这是一个创建于 1858 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

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

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4854 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 01:03 · PVG 09:03 · LAX 18:03 · JFK 21:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.