• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

html:option woes

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use the html ption tag to populate a select. Here's the relevant block of the jsp:

The problem is that this results in the option of the select being literally
<option value="<bean:write name='pkg' property='packageSearchPath'>
for each item. What am I doing wrong?

Thanks

[ November 15, 2005: Message edited by: Andrew McLaren ]
[ November 15, 2005: Message edited by: Andrew McLaren ]
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't nest tags as attributes to other tags.
You would have to use a <%= pkg.getPackageSearchPath() %> expression to get it in there, which means you would have to specify type on the <logic:iterate> tag.
Rather than using <logic:iterate> and <html:option>, the better approach would be to use either the <html:options> tag or the <html:optionsCollection> tag

http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#option
 
Andrew McLaren
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hrm, never used collections like this in Struts before, but it works like a champ!

Thanks a ton!

Andrew
 
Put the moon back where you found it! We need it for tides and poetry and stuff. Like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic