• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I use html:select?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello: I'm Struts starter... having problems with html:select, my question is:

How do I use the html:select tag for populating with options from database?

I'm using this next code

but I get an error:

"No getter method available for property event for bean under name org.apache.struts.taglib.html.BEAN"

Doc says nothing about the 'property' attribute at html:select needs to be associated with any bean, and the examples I watched around the web for populating set only the property attribute. As I understand, 'property' refers to the parameter the ActionForm (DynaValidatorForm) will wait to receive (in this case, 'event'), but the error is basically requesting me to associate the property to some bean.

So I change the code to:


When I do it so, that is, when I set 'name' property, the error changes to:

"javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean under name bean"


That's obvious as I've no one bean defined as "bean"... now, exactly, why would I need to define some bean at html:select, if I'm defining my bean with the options for populating at html:optionsCollection?

My code:

JSP:


struts-config.xml

Any help will be appreciated, thanks in advance :)
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP


struts-config.xml


LicenseForm.java


LicenseAction.java


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic