You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leonardo Maciel <le...@hotmail.com> on 2002/11/12 22:04:37 UTC

html:text indexed="true" inside logic:iterate help!

Hi all, I search the list and found some good samples, but I'm still unable 
to execute the following code.
The newEntryContinue.do action shows the correct name and description values 
with the <bean:write and the text boxes

When I submit I get:

javax.servlet.ServletException: BeanUtils.populate
...
root cause: java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.NullPointerException
	SurveyDetailForm.getParameter(SurveyDetailForm.java:816)
...
THE JSP:
========
<logic:iterate id="parameter" name="SurveyDetailForm" property="labArray" >
<TR><TD align="right">
	<bean:write name="parameter" property="name"/>&nbsp;
</TD>
<TD>
	<html:text size="10" maxlength="10" name="parameter" property="quantity" 
indexed="true" />
	<bean:write name="parameter" property="description"/>
</TD>
</TR>
</logic:iterate>

THE FORM:
=========
public class SurveyDetailForm extends ActionForm {
	private ArrayList labArray;
	public ArrayList getLabArray() {
		return labArray;
	}

	public void setLabArray(ArrayList labArray) {
		this.labArray = labArray;
	}
	public LabValues getParameter(int index)
	{
		return (LabValues)labArray.get(index);
	}

STRUTS-CONFIG:
==============
<action path="/newEntryContinue"
	type="NewEntryContinueAction"
	name="SurveyDetailForm"
	input="/newEntry.do"
        validate="true"
	scope="request"	>
<forward name="success" path="/WEB-INF/nyclt/detailEntry.jsp"/>
</action>

<action path="/newEntrySave"
	type="NewEntrySaveAction"
	name="SurveyDetailForm"
        validate="false"
	scope="request"	>
<forward name="success" path="/newEntry.do"/>
</action>

THE newEntryContinue:
=====================
Populates the array with
   detailForm.setLabArray( new ArrayList( pro.getLabValueList() ) );

LabValues objects that has get and set for
public final class LabValues implements Serializable {

    private Integer value;
    private String name;
    private String description;
    private String quantity;
    private String date;


What is wrong??
I appreciate any help.
Thank you
Leo

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>