Hi,

I need some help with the html:multibox tag.  I have the following situation
where I do a search for some clients and the search.jsp displays displays a
number of rows each with a checkbox associated with it.  The user can then
click one or many checkboxes and click submit.  The submit passes the data
onto the next action which should pull the data out of the array which holds
the checkbox values and go and retrieve there remaining data.

The problem I have is that the action gets called but the actionForm field
which holds the array of checkboxes is null. 

In my jsp I have the following:

<html:form action="/actionClient" 
name="actionClientForm"
type="com.web.forms.ActionClientForm">

<logic:iterate id="client" name="searchClientForm" property="results">

<td width="14%"> 
<div align="center">
<html:multibox property="resourceIds">
<bean:write name="client" property="resourceId"/>
</html:multibox>
</div>
</td>

the results property of searchClientform holds a list of clientVOs. The
clientVO has a field resourceId. please note that clientVO has filed
resourceID and action client form has field resourceIds.

The actionclientform is as follows:

private String [] resourceIds = {};


/**
* @return Returns the resourceIds.
*/
public String[] getResourceIds() {
return resourceIds;
}
/**
* @param resourceIds The resourceIds to set.
*/
public void setResourceIds(String[] resourceIds) {
this.resourceIds = resourceIds;
}

my struts config action mapping is as follows:

<action path="/actionClient"
type="com.web.action.ActionClientAction"
name="actionClientForm"
scope="request"
input="/searchClient.jsp">
<forward name="edit" path="/createClient.jsp"/>
</action>


The error thrown is:

java.lang.NullPointerException
com.medina.web.action.ActionClientAction.execute(ActionClientAction.java:44)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcess
or.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

The code throws a null pointer on the following line:

ActionClientForm clntForm = (ActionClientForm)actionForm;

System.out.println("resource Id = " + (clntForm.getResourceIds()).length);

So can anyone tell mewhat I am doing wrong and how to pass the value to my
action class.  After debugging the clntForm is not null. It is the
resourceIds array which is null.

thanks in advance  


********************************************************************

This email may contain information which is privileged or confidential. If you 
are not the intended recipient of this email, please notify the sender 
immediately and delete it without reading, copying, storing, forwarding or 
disclosing its contents to any other person
Thank you

Check us out at http://www.bt.com/consulting

********************************************************************


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

Reply via email to