Tôi có vòng lặp jstl và tôi muốn định dạng ngày của biểu mẫu: đầu vào. Tôi đã thử nhiều hoán vị của một số gợi ý mà tôi thích trực tuyến nhưng tôi không thể làm cho nó hoạt động được .. Có thể ai đó vui lòng xem không?Cách tạo fmt: formatDate làm việc cho biểu mẫu: nhập
Tôi đã bao gồm toàn bộ vòng lặp cho ngữ cảnh nhưng vấn đề nằm trong khối <td></td>
cuối cùng.
<c:forEach items="${valueTransactionsModel.transactions}" var="transaction" varStatus="loopStatus">
<tr class="${loopStatus.index % 2 == 0 ? 'even' : 'odd'}">
<spring:message code="valueTransactions.transactionType" var="transactionTypeLbl" />
<tags:dropdown id="transactionTypeId${loopStatus.index}" path="transactions['${loopStatus.index}'].valueTransactionType.id"
fieldName="${transactionTypeLbl}" classStyle="mandatory" items="${transactionTypes}" itemLabel="value"/>
</tr>
<tr class="${loopStatus.index % 2 == 0 ? 'even' : 'odd'}">
<spring:message code="valueTransactions.transactionAmount" var="valueTransactionAmountLbl${loopStatus.index}" />
<tags:input id="transactionAmountId${loopStatus.index}"
path="transactions['${loopStatus.index}'].valueTransactionAmount"
fieldName="valueTransactionAmountLbl${loopStatus.index}"
maxlength="30" classStyle="mandatory" />
<spring:message code="valueTransactions.transactionDate"
var="valueTransactionDateLbl${loopStatus.index}" />
<td>
<form:input type="text" path="transactions['${loopStatus.index}'].valueTransactionDate" cssClass="mandatory" value="<fmt:formatDate value="transactions['${loopStatus.index}'].valueTransactionDate" type="date" pattern="yyyy-MM-dd"/>" />
</td>
</tr>
</c:forEach>
vấn đề gần đây nhất của tôi là:
JSPG0055E: Không thể tạo một thuộc tính xml từ tên [giao dịch [] Giá trị [$ {loopStatus.index}]
Cảm ơn! Điều đó khá nhiều. Tôi chỉ cần tham khảo mô hình trong giá trị thuộc tính giá trị = "$ {valueTransactionsModel.transactions [loopStatus.index] .valueTransactionDate}" – HellishHeat