0
は私がJSTLフォーム:C内のテーブルセルで選択:forEachの
CUSTOMERLISTは(customerGroupとassignedVendor性質を持つ)接続エンティティを保持しているリスト内のすべてのレコード/行の表のセル内のドロップダウンリストを持つようにしたい
vendorListは、ベンダーのエンティティを保持している(名前と得意先プロパティを持つ
ここでは、私がこれまで持っているものです。
<form:form action="${pageContext.request.contextPath}/vendorAdmin/viewClients/${vendorGroupID}" method="post" >
<table class="table table-striped table-bordered table-hover " id="sample_1">
<thead>
<tr class="bg-success">
<th>Admin Name</th>
<th>Email</th>
<th>Username</th>
<th>Phone</th>
<th>Assign To</th>
<th></th>
</tr>
</thead>
<c:forEach items="${customerList}" var="connection" varStatus="cStatus">
<tr>
<td>${customerList[cStatus.index].customerGroup.name}</td>
<td class="text-center">${customerList[cStatus.index].customerGroup.customerList[0].email}</td>
<td class="text-center">${customerList[cStatus.index].customerGroup.customerList[0].username}</td>
<td class="text-center">${customerList[cStatus.index].customerGroup.customerList[0].phone}</td>
<td>
<form:select path="customerList[${cStatus.index}].assignedVendor.customerID">
<form:options items="${vendorList}" itemLabel="name" itemValue="customerID"/>
</form:select>
</td>
<td>
<a href="<spring:url value="/vendorAdmin/sendMessageToCustomer/${vendorGroupID}/${customerList[cStatus.index].customerGroup.userGroupID}" />"
><span class="glyphicon glyphicon-message "></span></a>
</td>
</tr>
</c:forEach>
</table>
</form:form>
エラー:
ERROR o.s.web.servlet.tags.form.SelectTag - Neither BindingResult nor plain target object for bean name 'command' available as request attribute
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute
at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:144)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:168)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:188)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:154)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.autogenerateId(AbstractDataBoundFormElementTag.java:141)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.resolveId(AbstractDataBoundFormElementTag.java:132)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:116)
at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:422)
at org.springframework.web.servlet.tags.form.SelectTag.writeTagContent(SelectTag.java:194)
at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:84)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:80)
誰かが間違っていると指摘できますか?
編集:私は十分に明確でないことをお詫び申し上げます。問題は、コントローラからcustomerListを取得できないということではありません。すべて正常に動作しますform:select
私はpath
で間違いをしているようで、フィールドにアクセスすることはできません。これは少し明確になりますようにお願いします。
にそれはコードなしでは不可能です。 –