Search code examples
javajspjstl

Unterminated <c:set tag - JSTL


I am getting the error "Unterminated <c:set tag - JSTL"

Code:

<c:set var="p" value="${entity.metadata().type().name()}${entity.metadata().type().version().toString().replace(".", "_")}"> </c:set>

I tried -

<c:set var="p" value="${entity.metadata().type().name()}${entity.metadata().type().version().toString().replace(".", "_")}"/>

too.


Solution

  • The way you use quotation marks is confusing for the parser. Once it meets the second ", it assumes it to be the end of the tag, hence the exception. Try this:

    <c:set var="p" value="${entity.metadata().type().name()}${entity.metadata().type().version().toString().replace('.', '_')}">