struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Caroline Jen <jiapei_...@yahoo.com>
Subject How Do I Create This Drop-Down List in Struts?
Date Sun, 30 Nov 2003 05:48:04 GMT
My ArrayList is a collection of bean object.  The
ArrayList is created this way:

public Collection findEditors( String userrole, String
category ) 
{
   ..........
   EditorBean editorBean = null;
   ArrayList editors = new ArrayList();
   // database access code
   while( rs.next() )
   {
      editorBean = new EditorBean(
rs.getString("user_name") );
      editors.add( editorBean );
   }
   return editors;
   .......
}

and my EditorBean is like:

public class EditorBean 
{
   private String name;

   public EditorBean() {}

   public EditorBean( String name )
   {
      this.name = name;
   }
   public String getName() {
      return Name;
   }
   public void setName( String name ) {
      this.name = name;
   }
}

After "editors" is returned, I create a session
object:

session.setAttribute( "EDITORS", editors );

How do I create a drop-down list for this collection
of editors?

<html:select size="1" property="??????"
multiple="false">
    <html:options collection="??????" property="name"
labelProperty="name"/>
</html:select>



__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Mime
View raw message