I want to add two conditions to an if in jstl , but it throws me an error.
<c:if test="${ISAJAX == 0 && ${ISDATE == 0}">
Compilation of JSP File '/WEB-INF/pages/index.jsp' failed:
homeafiliado.jsp:792:61: Syntax error in expression. Encountered "{".
I remain attentive, Greetings.
Expression Language (EL, the content inside
${}
) is used to parse expressions and convert them into Java code. You don't need to embed EL inside EL. Your expression can be corrected by removing the${}
inner.It should be like this:
You can even rewrite it in an easier to understand way:
The UEL processor only processes what is inside a construct
${...}
.Solution: The entire expression must be inside the braces.
It even prevents whitespace from being left outside the curly braces,
because as long
"true "
as they"false "
are converted tofalse
( https://ideone.com/bHX49T )