CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Dec 2006
    Posts
    2

    Struts Form Bean Setter method not getting invoked for Select Box

    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 :

    Code:
    <html:select title="sel1" property="selectedInquiryTypes" size="5" multiple="multiple" name="userPreferencesForm">
    							<html:options 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
    Last edited by Dr. Script; December 1st, 2006 at 06:58 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured