Why does this code generate an End Tag error & lt; / c: when is "unbalanced"?

I do not understand why I get the error message:

End tag "</ c: when" unbalanced

when this code is running:

<c:choose> <c:when test="${label == 'Apple'}"> <form:form modelAttribute="fruit" action="/fruit/${fruitId}" method="post"> <form:input path="fruitId" type="hidden" value="${fruitId}"/> </c:when> <c:when test="${label == 'Orange'}"> <form:form modelAttribute="fruit" action="/fruit/${fruitId}" method="post"> <form:input path="fruitId" type="hidden" value="${fruitId}"/> </c:when> </c:choose> 
+4
source share
2 answers

You have a private <form:form> .

+6
source

In my case, I found that the problem was using the html comment syntax to comment on JSTL codes. So double-check your html file containing the JSTL syntax to verify that you made the same error. Please refer to the example below:

 <!-- <security:authorize access="hasAnyRole('ASSOC_COMPANY','PUBLIC_COMPANY', 'INDIVIDUAL')"> --> 

change the comment above below.

 <%-- <security:authorize access="hasAnyRole('ASSOC_COMPANY','PUBLIC_COMPANY', 'INDIVIDUAL')"> --%> 
0
source

Source: https://habr.com/ru/post/1387975/


All Articles