I have this JSP code snippet:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:choose>
<c:when test="${var1.properties[\"Item Type\"] eq \"Animal's Part\"}">
<c:set var="cssClassName" value="animalpart" />
</c:when>
<c:otherwise>
<c:set var="cssClassName" value="" />
</c:otherwise>
</c:choose>
The JSP cannot be compiled by the server. However, if I remove the character "'" from "Animal's Part", it is compilable. I tried to escape it by using "\" character but it still gives me error.
Any suggestion/help is appreciated. I tried to avoid using scriptlet if possible.
Thanks.
EDIT: I managed to get it working (after posting to StackOverflow), posted as one of the solution in this question. I tried other solution posted before that (by Vincent and Eddie), however, unfortunately, none works in my environment, although I reckon that they might works in the answers' environment. Thanks.