I have simple JSP:
<jsp:directive.attribute name="severity" type="java.lang.String" required="true"/>
<jsp:directive.attribute name="currentSeverity" type="java.lang.String" required="true"/>
<c:if test="${severity ne currentSeverity}">
<c:url value="/session" var="url">
<c:param name="severity" value="${severity}"/>
</c:url>
<li><a href="#" onclick="$.ajax({
type: 'GET',
url: '${url}',
success: function() {
window.location.reload();
}
});"><c:out value="${severity}"/></a></li>
</c:if>
But when I'm evaluate it servlet engine throws:
org.apache.jasper.JasperException:
/WEB-INF/tags/severity-position.tagx(17,9) PWC6287:
The attribute prefix success does not correspond to any imported tag library
Somehow JSP engine thinks that $.ajax({...});
string is JSP EL expression (no matter what characters are placed between $
and {
). When I backslash {
or $
it's all ok, but then my IDE thinks that this code is broken JS code.
So, why JSP engine thinks that $.ajax({...})
is JSP EL expression?