This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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...