struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siggelkow, Bill" <bill.siggel...@mirant.com>
Subject RE: Ye olde html:options tag?
Date Thu, 02 Jan 2003 21:32:04 GMT
Try using the 'collection' attribute instead of 'name' ... otherwise, the tag interprets the
name/property combination as identifying the collection.

    <html:options collection="users" property="email" labelProperty="email"/>

\-----Original Message-----
From: Michael P [mailto:struts@krimedawg.org]
Sent: Thursday, January 02, 2003 4:17 PM
To: struts-user@jakarta.apache.org
Subject: Ye olde html:options tag?


I apologize for this basic question, but I'm new to struts and Java web
programming in general, and I really can't get the <html:options> tag to
work...

The error I'm getting, specifically, is:
  javax.servlet.jsp.JspException: No getter method available for property
        email for bean under name users

My JSP defines a collection like this:
  <bean:define id="users" name="adminLoginForm" property="users"
        type="java.util.Collection"/>

Then tries to use it like this:
  <html:select property="email">
    <html:options name="users" property="email" labelProperty="email"/>
  </html:select>

My understanding of this is that it will call getUsers() on the
adminLoginForm bean to get a Collection, and then on each item within the
collection, will call getEmail() to retrieve the option property and
label.

Do I need to define a bean somewhere (in some XML file?) for the user
objects contained within the collection or something?  The collection
contains UserView objects that /do/, in fact, have a getEmail() method, so
I can't figure out why this won't work.

I have defined a form-bean for the login form:
  <form-bean
        name="adminLoginForm"
        type="com.federalresearch.fillouts.login.AdminLoginForm">
    <form-property name="email" type="java.lang.String"/>
  </form-bean>

Thanks for any help you can offer...

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message