Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieving list (multiple select on the form) values into servlet!!!  RSS feed

 
karls Bernando
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to retrieve the values selected in a list item (selecting multiple items). How do I retrieve all selected values for that listbox into the servlet? If I try : reqeust.getParameter("listbox"), it returns the first selected value only. How do I get all the selected values?
Help is appreciated.
karls
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String[] myValues = request.getParameterValues("myList");
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karls,
Javaranch has a naming policy which is strictly enforced. Please read this policy and change your display name to one that conforms if you would like to keep posting here. Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!