0
<c:forEach items="${list.productList}" var="dto" varStatus="status">
<tr>
  <td></td>
  <td></td>
  <td></td>
</tr>
.......
.......
</c:forEach>

<spring:hasBindErrors name="productDto">
<c:if test="${errors.hasFieldErrors('productList[ *INDEX* ].count') }">
ERROR MESSAGE
</c:if>
</spring:hasBindErrors>

I would like to print the error message if the errors exist. However, there already exist double and single quotations and EL tag. So, putting index doesn't work well.
I tried
<c:if test="${errors.hasFieldErrors('productList[ ${status.index} ].count') }">,
<c:if test="${errors.hasFieldErrors('productList[ [status.index] ].count') }">
, but still doesn't work. Please have a look at this. Thank you.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
nextlevel
  • 1
  • 1
  • Use `${errors.hasFieldErrors(productList[status.index].count)}` – Jasper de Vries Jul 12 '22 at 13:23
  • Does this answer your question? [How to nest an EL expression in another EL expression](https://stackoverflow.com/questions/15592614/how-to-nest-an-el-expression-in-another-el-expression) – Jasper de Vries Jul 12 '22 at 13:24
  • @JasperdeVries Thank you for your comment. Based on that, I tried some other options. This way worked! ` ` `` Thank you. – nextlevel Jul 13 '22 at 00:21

1 Answers1

0

use a tick ( ` ) instead of opening and closing quotes

`${.......} some other stuff`;
Yesthe Cia
  • 528
  • 1
  • 7
  • 20