If a parameter is not specified at all like so,
http://example.com/context/servlet?x=foo
then it will return null
:
String x = request.getParameter("x"); // "foo"
String y = request.getParameter("y"); // null
If a parameter is specified, but does not have a value like so,
http://example.com/context/servlet?x=foo&y
then it will return an empty string:
String x = request.getParameter("x"); // "foo"
String y = request.getParameter("y"); // ""
Makes sense, right?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…