CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  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.

  2. #2
    Join Date
    Dec 2006
    Posts
    2

    Re: Struts Form Bean Setter method not getting invoked for Select Box

    Please reply.
    Madhan

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: Struts Form Bean Setter method not getting invoked for Select Box

    Quote Originally Posted by madhan_a
    Please reply.
    Madhan
    You didn't even wait 4 minutes for a reply?!!?!!?? You need to learn patience. In a forum, sometimes answers don't come for days.

    Anyway, you posted in the wrong forum. JSP is a server-side language. You posted in the client-side. I will have a moderator move it.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

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