I'm having troubles with html:options tag, I was hoping for some insight.

I've got an ActionForm called "myForm".

On that form, I've got a String field iD, and a Collection (Vector) of
Struts LabelValueBeans called "myCollection".  Appropriate getters and
setters, too.  Code below.

On my JSP. I've got 

<html:text property="myCollection"/>
<html:select property="iD">
<html:options collection="myCollection" property="value"
                   labelProperty="label"/>
</html:select>

The <html:text> tag works properly and produces:
 [LabelValueBean[0, January], LabelValueBean[1, February]] - as expected.

the <html:options> tag produces "org.apache.jasper.JasperException: Cannot
find bean under name myCollection".

I don't understand the differences in scope between the <html:text> and
<html:options>.

What do I need to do so that <html:options> can find my Collection on the
form?


package myApp.forms;

import java.util.Collection;
import org.apache.struts.action.ActionForm;

public class myForm extends ActionForm {

    private Collection myCollection;
    private String iD;

    public WageReportEditForm() {
                super();
    }

    public String getID() {
        return iD;
    }

    public void setID(String s) {
        this.iD = s;
    }

    public Collection getMyCollection() {
        return myCollection;
    }

    public void setPlanList(Collection c) {
        this.myCollection = c;
    }  
}

_Am

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to