The problem with using request.getParameter() is that if the request parameters are sent in chunks then you may only get the first chunk and so won't be able to access the parameters/values in subsequent chunks. That is why I use request.getReader().
Joined: Jan 22, 2004
The problem was the the request was coming from an html form.
I added this line at the end of my code snippet, and now it works fine...