Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Thanks for the answer! It gave me a better insight. I do have 2 follow up questions though. 1) I can't change the request, but can't I wrap the request into a form that I want? 2) I can do a classical parsing and String manipulations(this was my 1st approach also), however how can I pass this String to HttpRequest to be processed by the Servlet? Thanks.
    – obayral
    Commented Jan 12, 2021 at 21:17
  • 1
    1) that's exactly what I'm saying in the answer. You wrap the original request into your own version with the help of HttpServletRequestWrapper. In your version you change what you want different and let everything else go through to the original request object you wrapped. 2) You will probably need to implement the getInputStream method in your wrapper to return an InputStream constructed from your String (maybe some other methods from the wrapper too, depending on what else you need). You then send the wrapper request to your servlet in the chain, not the original request.
    – Bogdan
    Commented Jan 13, 2021 at 9:38