Why does this code generate the error “The end tag ”</c:when“ is unbalanced”?

后端 未结 3 1406
一整个雨季
一整个雨季 2021-01-18 17:53

I don\'t understand why I get the error:

The end tag \"

when this code is run:


         


        
相关标签:
3条回答
  • 2021-01-18 18:35

    For me, I forgot to close a JSTL tag.

    This is where should I fix

    <c:set var="attendance" value="${hallManager.selectAttandanceRegisterByAttID()}" >
    

    And after I changed to this it's fine.

    <c:set var="attendance" value="${hallManager.selectAttandanceRegisterByAttID()}" />
    

    or

    <c:set var="attendance" value="${hallManager.selectAttandanceRegisterByAttID()}" ></c:set>
    

    Some tricks to fix this problem quickly: If you have IDEs like Netbeans, please try 1.Collapse all tags and expand one by one to see which one you did not close. 2. Type " and look at the popup menu(if you have enabled it). If there is any unclosed tag it will show up.

    0 讨论(0)
  • 2021-01-18 18:56

    You have an unclosed <form:form> tag.

    0 讨论(0)
  • 2021-01-18 18:59

    In my case I found that issue was using html comment syntax to comment out JSTL codes. Therefore recheck your html file which contains JSTL syntax to check you have done the same mistake. Please refer below example:

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

    change above comment to below comment.

    <%-- <security:authorize access="hasAnyRole('ASSOC_COMPANY','PUBLIC_COMPANY', 'INDIVIDUAL')"> --%>
    
    0 讨论(0)
提交回复
热议问题