Why is HttpServletRequest inputstream empty?

后端 未结 7 1633
春和景丽
春和景丽 2020-11-30 05:52

I have this code where I read the input from a request input stream and use a JacksonMapper to convert into a POJO. Its running in a jetty 7 container with guice support.

相关标签:
7条回答
  • 2020-11-30 06:40

    Systematic approach is:

    1. Get source code for your container, or at least it's web part (can be hard to find), import in your IDE.
    2. Make break point in your code where before HttpServletRequest->getInputStream() is called.
    3. Step into HttpServletRequest->getInputStream() method, now you are in some ...Impl class.
    4. Set a new break point in that getInputStream() implemmentation, or even in its read() method.
    5. Repeat test call and see what is consuming your data.
    0 讨论(0)
提交回复
热议问题