Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javaservlet req object question

Status
Not open for further replies.

786snow

Programmer
Nov 12, 2006
75

Hi, I am new to javaservlet. From the request object i do something like that to get the values. ios there a better way whete you can loop through and get the values.
Do they come in a array?

****************
String cStatement = req.getParameter("cStatement");
String cTradeCnf = req.getParameter("cTradeCnf");
String cTaxDoc = req.getParameter("cTaxDoc");
String email = req.getParameter("email");
String check_all = req.getParameter("check_all");

****************************
Thanks
 
The parameter name/value pairs are available as a map. You can obtain the Map itself with getParameterMap() and iterate through its keySet to get the parameter names, or its values collection for the values. They won't necessarily come out in any predictable order though.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top