File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Store arrayList into DropDownList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » JSP
Bookmark "Store arrayList into DropDownList" Watch "Store arrayList into DropDownList" New topic

Store arrayList into DropDownList

Shamsa Al Neyadi

Joined: Nov 04, 2012
Posts: 2
Hello ,

Guys I'm trying to store the ArrayList items into dropDownList , it created fields for them but they are empty.

this my code :

i tried for loop also , i faced the same problem.

help me please.

kind regards
zohaib khan

Joined: Apr 13, 2009
Posts: 22
Hi Shamsa Al Neyadi,

You can use FOR loop to iterate over array list

- Thanks
Shamsa Al Neyadi

Joined: Nov 04, 2012
Posts: 2
i used it , but does not work !
BTW , i don't want to print the values of the arraylist , i want to store the arraylist items into dropdownlist.
Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 90

First off you shouldnt be using scriptlets in jsp, makes it messy really.
Second, you are missing the value attribute in your option tag.
Third, you should post more information on what happens when you run the code.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62099

Please read this JspFaq entry.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
subject: Store arrayList into DropDownList