NotReadablePropertyException:bean类的属性'productss'无效[java.util.ArrayList]

时间:2017-02-25 02:15:05

标签: java spring netbeans

org.springframework.beans.NotReadablePropertyException: Invalid property
'productss' of bean class [java.util.ArrayList]: Bean property
'productss' is not readable or has an invalid getter method: Does the
return type of the getter match the parameter type of the setter?

在Url git put / Jenuaz之后

我有关于git的项目:ShopJavaProject,我的git id:jenuaz。

1 个答案:

答案 0 :(得分:0)

您在OrderesController中使用此模型:

@ModelAttribute("orderes")
    public Orderes getFrom (){
        return new Orderes();
    }

您必须在jps页面表单而不是orderess上使用它。此外,产品字段名为product而不是productss,产品列表名为products

<form:form class="form-horizontal" action="/admin/" method="POST" modelAttribute="orderes">
        <div class="form-group">
            <label for="orderes" class="col-sm-2 control-label">Product</label>
            <div class="col-sm-10">
                <form:select class="form-control" path="product" id="products" items="${products}" itemValue="id" itemLabel="name"/>
            </div>