File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes passing an array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "passing an array" Watch "passing an array" New topic

passing an array

Daniel Layher

Joined: Jul 14, 2006
Posts: 19
I know this sounds super easy but i can't figure it out. I have a select box that is populated on the fly through a database. The select box is also has multiple set to true so you can choose more than one option. However, every time i try to pass it to the servlet it, only the first selection is passed. I'm pretty sure that it is set up as an array, but I'm not sure how to pass the array, which doesn't have a set size, to the servlet. Any suggestions??? Thanks ahead of time.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Which method did you call in your servlet ? Did you try getParameterValues ?

[My Blog]
All roads lead to JavaRanch
Daniel Layher

Joined: Jul 14, 2006
Posts: 19
Worked like a charm. Thank you. I was just using .getParameter(). that made all the difference. Thanks again.
I agree. Here's the link:
subject: passing an array
It's not a secret anymore!