Class 2 |
Intermediate Java 30-IT-397 |
|
Using Form Data
-
Using form data allows us to dynamically generate a web page based on user
input.
-
Use the GET and POST methods we've talked about before.
-
The server kindly performs the URL deconding for us, so that we can just
access the variables via the getParameter() method of ServletRequest.
-
Pass in the parameter (key) name.
-
Returns the value if one exists, an empty string of no value exists for
that key, and null if no such key exists.
-
Parameter names are case sensitive.
-
getParameterValues() returns a String array of the values.
-
getParameterNames() returns the keys as an enumeration.
Example

Created by: Brandan Jones
December 20, 2001