This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
MULTIPLE select - list box - how to read in servlet
Rao Nadella
Greenhorn
Joined: Jan 19, 2001
Posts: 16
posted
0
Is there any way to read the MULTIPLE selected items in the list box from a JSP page to be read in the servlet. I used the getParameterNames with the Enumeration object and the items that shows up as selected is the 1st one selected in the list - meaning if there are 10 items and if I select 3rd,4th and 5th items the selected item is shown as 3rd. And if I select 6,7 and 8th items the item selected is shown as 6th. How can I get the items that are selected on the list box with a MULTIPLE option? Appreciate any help, thank you. -R
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
If a particular parameter can have multiple values, you have to use getParameterValues. So in your case: String[] values = yourParameterName.getParameterValues(). Then iterate through the array to get alla the values for your parameter.
------------------ Bosun SCJP for the Java� 2 Platform
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley