This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes not able to display arrayList properly using html:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "not able to display arrayList properly using html:select" Watch "not able to display arrayList properly using html:select" New topic
Author

not able to display arrayList properly using html:select

shanthi naidu
Ranch Hand

Joined: Nov 13, 2008
Posts: 39
Hi,

I need to display country names in <html:select>
able to get the list of values in an array but using the below code
not able to display them properly they are resulting like this
along with the angular brackets as a single list option...
but i want to display them in <html:select> as


i hope i explained my problem clearly

The Code i used in my JSP



Please suggest me what i have to do

Thanks,
Shanthi Naidu
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Because you're explicitly displaying the list (arrList), instead of each object of the iteration.

You could also use html:options or html:optionscollection.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: not able to display arrayList properly using html:select
 
Similar Threads
Not able to iterate through a bean property of type Array List
Struts ArrayList Display in JSP
Need help selected text fields visible for particular option from drop down list in JSP(struts)
dependable or linked dropdown lists
JSTL conversion for struts 1.1 code