Please be more descriptive in describing what went wrong. request.getParameter() works fine for POSTs. Are you using a multipart form, perhaps? There is no way a getParameter() returned anything like "NOT FOUND" unless that was the actual data; if a parameter wasn't found it would return null.
Kenneth Owino wrote:...but have still failed to find a clear example on how i can read individual parameters assigning them to given variables like it is with doGet()...
If you know how to retrieve parameters with a GET request (as it seems like you know in your above statement) it's no different with POST except which method (i.e: doPost()) in which you do that.
Kenneth Owino wrote:... How can I send the parameters without attaching them to the url and recieve them at the servlet?
By sending a POST request to the server..
... I read that with POST you can send parameters as part of the request body
Correct. Thats one of the key differences in GET and POST.
Please let me know why POST is only working when I use the url with parameters attached and not when I send them in the body.
There should be something wrong the way you use it.
Could this mean that getParameter only works when the parameters were sent as part of the url?
Does this help at all?
Moving to the appropriate forum.
The REAL problem is that you don't understand how HTTP POST works.
When you send down a request using request-type POST, you're saying that there will be an accompanying data stream coming along with the URL and headers.
That's all you're saying.
The format of that data stream is actually completely up to you. Properly done, the data stream includes MIME-encoding information to tell the server what format that data stream has.
In real-world terms, however, web browsers will often be sending the contents of a FORM.
Here's a short reference on that: http://en.wikipedia.org/wiki/POST_(HTTP)
The actual parsing of that data stream is up to server-side code. It's too early on a Monday morning for me to remember if the Java HttpServlet class code does that for you or if you have to do it yourself. Since mostly I'm using support frameworks these days, I don't have to worry about it.