wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Store arrayList into DropDownList" Watch "Store arrayList into DropDownList" New topic
Author

Store arrayList into DropDownList

Shamsa Al Neyadi
Greenhorn

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
Greenhorn

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


You can use FOR loop to iterate over array list




- Thanks
Zohaib.
Shamsa Al Neyadi
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

Please read this JspFaq entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Store arrayList into DropDownList
 
Similar Threads
How to get default value to my dropdown list
Dout on EL question in Enthuware test Kit?
Java script is not populated on webpage.
dynamic drop down boxes
How to use for loop inside of dropdownlist at jsp?