Combo Box problem in struts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ksusant
    New Member
    • Feb 2008
    • 1

    Combo Box problem in struts

    Plz help me..

    I have 3 combo box in a jsp. I want to display 2nd combo box value with respect to selected 1st combo box value which will be of type onchange and 3rd w.r.t. 2nd selection.
    And all the values will retrieve from the database.

    This is my jsp...
    Code:
      <html:form action="/nodeAction.do" >
     	<table ><tr><td align="center"><b>NODE DETAILS</b></td>
    	</tr></table>
                    <table > <tr> <td align="right">Customer Name:</td> 
    	<td align="left"><html:select property="customername" onchange="submit()">
    				         			<html:option value ="">Please select</html:option>
    	<html:options collection="contactcustomername" property="customerv"/>
    	</html:select>
    	</td></tr></table>
    	 </html:form> 
         
         	 <html:form action="/nodeAction.do" >     				<table > <tr><td align="right">Location Name:</td> 
    	<td align="left"><html:select property="locationname" onchange="submit()">
    				         			<html:option value ="">Please select</html:option>
    				         			<html:options name="nodelocationname" collection="nodelocationname" property="nodelocv"/>
    	</html:select></td>
             <td align="right">Room Number:</td> 
        <td align="left"><html:select property="roomnumber" >
        <html:option value ="">Please select</html:option>
    </html:select>
    	</td></tr></table>
      </html:form>
    And in Action class
    I have...
    Code:
    request.setAttribute("contactcustomername", customernames);
    request.setAttribute("nodelocationname",locationnames);
    where customernames and locationnames are two arraylists.

    Whenever I am executing my application it is giving the error like
    Code:
    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean under name nodelocationname
    But if I will remove
    Code:
    <html:options name="nodelocationname" collection="nodelocationname" property="nodelocv"/>
    for the first time and after executing the application if i will put the code once again then it is working....
    Last edited by Nepomuk; Dec 8 '08, 10:02 AM. Reason: Please use [CODE] tags
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Do you ahave the bean metioned in the error?
    "Cannot find bean under name nodelocationnam e"

    Comment

    Working...