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
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: 61095
    
  66

Please read this JspFaq entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Store arrayList into DropDownList