In your action class, are you actually populating a List in your form before forwarding to that page?
>From the error, it appears that getTableNames() on your form is returning null. -- James Mitchell ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 5:30 PM Subject: using <bean:define> > Hi, > > I am new to struts. > > I am trying to use the > > <html:options collection="tableNames" > > I get the error > > javax.servlet.jsp.JspException: Define tag cannot set a null value > at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:272) > at jsp_servlet.__mffs._jspService(__mffs.java:237) > > > What am I doing wrong when I am trying to create the bean > > <bean:define id="tableNames" > name="mffsActionForm" > property="tableNames" > type="java.util.List" /> > > Regards > Rajesh J > > Here is the JSP code > > <%@ page contentType="text/html;charset=UTF-8" language="java" %> > > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> > > <html:html> > > <head> > > <title>MFFS</title> > </head> > > <body topmargin="0" leftmargin="0"> > > <table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"> > <tr> > <td width="100%" height="72" bgcolor="#000066" style="color: #FFFFFF"> > <strong><font size="8" face="ATSackLightRomNoBalls"><html:img width="61" > height="45" src="images/top.bmp" border="0"/>MFFS</font></strong></td> > </tr> > <tr> > <td width="100%" height="20" bgcolor="#EAFFFF"> </td> > </tr> > <tr> > <td width="100%" height="95%" valign="middle" align="center"> > <html:form > action="mffsAction" > name="mffsActionForm" > type="lam.mffs.form.MffsActionForm" > scope="session" > > <p> > </p> > <table border="1" height="33" bordercolor="#000000" bordercolorlight=" > #000000" bordercolordark="#000000"> > <tr> > <td width="100" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"><font size="2">End > Date</font></td> > <td width="100" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"> <html:text property > ="end_date" size="10"/></td> > <td width="150" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"><font size="2"> Choose > Table</font></td> > <td width="200" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"> > <font size="2"> > <bean:define id="tableNames" > name="mffsActionForm" > property="tableNames" > type="java.util.List" /> > > <html:select property="tables" style="font-size: 10pt" size="1"> > <html:options collection="tableNames" labelProperty > ="labelProperty" property="property"/> > </html:select></font></td> > <td width="200" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"><font size="2"> Product > Description</font></td> > <td width="300" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"><font size="2"> > </font></td> > <td width="130" height="27" bordercolor="#FFFFFF" bordercolorlight=" > #FFFFFF" bordercolordark="#FFFFFF" bgcolor="#e0ebf5"><applet code > ="fphover.class" codebase="./" width="120" height="24"> > <param name="color" value="#000080"> > <param name="hovercolor" value="#0000FF"> > <param name="textcolor" value="#FFFFFF"> > <param name="text" value="Get Data"> > <param name="effect" value="glow"> > </applet> > </td> > </tr> > </table> > <p> > > </p> > </html:form> > > </td> > </tr> > </table> > > </body> > > </html:html> > > > here is my formbean > > public class MffsActionForm extends ActionForm > { > private String tables; > private List tableNames; > private Date end_date; > private List product_desc; > public void setTables(String Tables) > { > this.tables = Tables; > } > public String getTables() > { > return tables; > } > public void setEnd_date(Date end_date) > { > this.end_date = end_date; > } > public Date getEnd_date() > { > return end_date; > } > public void setProduct_desc(List product_desc) > { > this.product_desc = product_desc; > } > public List getProduct_desc() > { > return product_desc; > } > public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest > httpServletRequest) > { > /**@todo: finish this method, this is just the skeleton.*/ > return null; > } > public void reset(ActionMapping actionMapping, HttpServletRequest > httpServletRequest) > { > tables = null; > end_date = null; > product_desc = null; > } > public List getTableNames() > { > return tableNames; > } > public void setTableNames(List tableNames) > { > this.tableNames = tableNames; > } > } > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]