Click to See Complete Forum and Search --> : Struts Form Bean Setter method not getting invoked for Select Box


madhan_a
12-01-2006, 01:26 AM
Hi,
Could anyone help me to solve the following issue :

I have a Struts Form bean corresponding to a <html:form> in the JSP.

The JSP form consists of select box which allows multiple selection.

When the form gets submitted , the setter method for the options is not

getting invoked by the struts. In the form bean i have a String[] array

corresponding to the JSP select options. I have also tried using

ArrayList, but the same problem persists.

My JSP code snippet :

<html:select title="sel1" property="selectedInquiryTypes" size="5" multiple="multiple" name="userPreferencesForm">
<htmlptions name="userPreferencesForm" property="allInquiryTypes"/>
</html:select>


In the form bean , I have :

public String[] getSelectedInquiryTypes() {
return selectedInquiryTypes;
}
public void setSelectedInquiryTypes(String[] selectedInquiryTypes) {
this.selectedInquiryTypes = selectedInquiryTypes;
}


I get the following error :


javax.servlet.ServletException: Property allInquiryTypes returned a null value

Please help me by provifing ur thoughts.

Thanks,
Madhan

madhan_a
12-01-2006, 01:29 AM
Thanks
Madhan

sedan85
05-12-2008, 07:14 AM
if u've found the solution help me

Hack
05-12-2008, 12:34 PM
if u've found the solution help meAre you running the same kind of code as the OP?