• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

How to populate a drop down box built with Struts html tag dynamically with the iterator

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I'm trying to populate a select field with options coming from an array list. I cannot use optionsCollection because I have to assign an id to every option element (it's a requirement I cannot bypass). My idea was to use an iterator within the select tag, but i get an JSP compile exception. It has to do with the way I add the value attribute in the option element. Below is the code:



It doesn't even compile. It complains that codeBean cannot be resolved.

When I try:



There is another exception. Now it says there is a problem in the attribute codeBean.

Any suggestions? Thanks in advance for your time...
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You cannot have one custom tag nested inside another. <bean:write nested in <html option is not valid


Thanks,
Praison
 
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!