jstl-api
jstl-api copied to clipboard
Bug in JSTL expression evaluator
When upgrading a legacy jsp-application with latest spring-boot dependencies,
it looks like we hit a minor bug in: javax.servlet:jstl:jar:1.2
Testcase:
<c:set var="zz" value="${1}" />
<c:if test="${(zz) > 0}">XXX</c:if>
in a jsp-file, yields a compilation-error:
[${(zz) > 0}] contains invalid expression(s): [javax.el.ELException: Error Parsing: ${(zz) > 0}]
This error did not occur in the older version.
For some reason, it seems it rejects the paranthesized expression: (zz)
when there is only a single variable inside.
Remove the parenthesis, and the error goes away.
Also, if you for example change the code to:
<c:if test="${(zz+zz) > 0}">XXX</c:if>
or
<c:if test="${(1) > 0}">XXX</c:if>
these are both accepted without any errors.