The request. getparameternames () method obtains (including buttons) All form objects with name attributes in the Form on the sending request page. An Enumeration type enumeration is returned. Traverse through the hasmoreelements () method of enumeration. Obtain the enumerated value by the nextelement () method. The value is the value of the name attribute of all controls in form. Finally, the value of the Form Control is obtained through the request. getparameter () method. Enumeration pnames = request. getparameternames (); While (pnames. hasmoreelements ()){ String name = (string) pnames. nextelement (); String value = request. getparameter (name ); Out. Print (name + "=" + value ); } The request. getparametervalues ("name") method obtains the value of "name" in all form forms. This method returns an array. You can retrieve the value by traversing the array. String values = request. getparametervalues ("name "); For (string value: values ){ System. Out. println (value ); } Request. getparameternames () values are unordered. Request. getparametervalues () is arranged in the control order of the from form. |