Servlet: Reading in HTML Form Data
- A common use of an HTTP Servlet is to process HTML form data.
- HTML Form data is sent via a GET or POST Method, and is in name/value pairs refered to as parameters.
How to read in HTML form data in a Servlet:
do the same thing regardless of wether a GET or POST submission 1) Inside of the doGet and/or doPost methods of your servlet invoke the getParameter or getParameterValues methods of the HTTPServletRequest instance. |
If desired you can read the Raw, unparsed, non
URL-decoded form (query) data.
Reader r = request.getReader(); |