I have the following code (jsp)
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<script type="text/javascript">
$(document).ready(function() {
<c:forEach items="${messages}" var="msg" varStatus="i">
alert("${msg.description}");
</c:forEach>
});
</script>
Ans messages
is an Arraylist
which passed into this JSP from a controller.
model.addAttribute("messages", messages);
return "the_above_jsp";
This was working fine until the description
value hold the following string value.
New task assigned from project Hip Tensile Strength Analysis : Data Management/Analysis Task due date is 20140408
When description
has this value it will show the error Uncaught SyntaxError: Unexpected token ILLEGAL
Why is that ?