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 comma seperated values as parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Passing comma seperated values as parameter" Watch "Passing comma seperated values as parameter" New topic

Passing comma seperated values as parameter

Skanda Raman
Ranch Hand

Joined: Mar 21, 2008
Posts: 205

I have requirement where there is a select box listing 600 entries. There is a ALL option to select all these entries. I can select multiple values as well.

Assume i select 570 entries, currently using java script i get the selected values and set the same in request through hidden parameter and passing to action class.

I am not sure if this is a best practice, as the number might grow in future from 600 to 1000 also.

Please suggest me if there is a best practice in this scenario.

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

why hidden fileds here? Use request.getParameterValues("multiSelectedValues") on server!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

I agree -- it sounds like you are trying to be too clever. Why are you not just using the straight-forward approach?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Passing comma seperated values as parameter
It's not a secret anymore!