• 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

"No name specified" - html:select and html:options

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most things in struts have come pretty easy for me, but <html:select> and <html:options> are really giving me fits.

Here's my code:



A CourseBean extends ValidatorForm and it has two members (courseId, courseName) with associated getters/setters.

CourseBean is defined in struts-config.xml and is mapped to /loadCourse.do.

When this page loads, if I have an EMPTY ArrayList stored in a session attribute keyed by "courses". The page loads a blank listbox and displays fine.

When the "courses" ArrayList is filled with "CourseBean" objects that I would like displayed, I get the following exception:

org.apache.jasper.JasperException: No name specified
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
<snip>


root cause

java.lang.IllegalArgumentException: No name specified
at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:240)
<snip>

What am I doing wrong?

Thanks in advance!

Aaron

[ June 29, 2005: Message edited by: Aaron Wilt ]
[ June 29, 2005: Message edited by: Aaron Wilt ]
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Try this :

 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That seemed to do it! Thanks!!!

I always screw up some mundane detail



cheers!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic