Minutes after posting, I found a solution. Script should use jstl instead of the other way around. Adding
<script> $(document).ready(function() {
<c:forEach items="${cars}" var="c">
add_tag("${c}");
</c:forEach>
// rest of script adding functions
...
solves my issue.