java - Exception while iterating in JSP -
i have class product
has field list<productcategorydetail>
, productcategorydetail
has field of category
type , category
has field list<subcategory>
.
product | |----- list<productcategorydetail> | |----category | |---------list<subcategory>
my objective iterate on list of productcategorydetail
object product
.
i using following code in jsp:
<c:foreach items="${product.productcategorydetails}" var="productcategorydetails" varstatus="status"> <tr id="category_row"> <td> <form:label path="productcategorydetails[${status.index}].category">category</form:label> </td> <td> <form:select cssstyle="width:134px" path="productcategorydetails[${status.index}].category.id" cssclass="category"> <form:options items="${categories}" itemvalue="id" itemlabel="name"/> </form:select> </td> <td> <form:label path="productcategorydetails[${status.index}].subcategory">subcategory</form:label> </td> <td> <form:select cssstyle="width:134px" path="productcategorydetails[${status.index}].subcategory.id" cssclass="subcategory"> <form:options items="productcategorydetails[${status.index}].category.subcategories" itemvalue="id" itemlabel="name"/> </form:select> </td> </tr>
categories drop down working fine subcategories drop down not getting created , throwing following exception:
16:19:17,342 error http-bio-8080-exec-10 form.optionstag:82 - type [java.lang.string] not valid option items javax.servlet.jsp.jspexception: type [java.lang.string] not valid option items
Comments
Post a Comment