What does request.getParameter return?

The Solution to What does request.getParameter return? is


Per the Javadoc:

Returns the value of a request parameter as a String, or null if the parameter does not exist.

Do note that it is possible to submit an empty parameter - such that the parameter exists, but has no value. For example, I could include &log=&somethingElse into the URL to enable logging, without needing to specify &log=true. In this case, the value will be an empty String ("").

~ Answered on 2011-12-08 02:15:34


Most Viewed Questions: