How do I check two conditions in one <c:if>
? I tried this, but it raises an error:
<c:if test="${ISAJAX == 0} && ${ISDATE == 0}">
Use two if statements if both if statement conditions could be true at the same time. In this example, both conditions can be true. You can pass and do great at the same time. Use an if/else statement if the two conditions are mutually exclusive meaning if one condition is true the other condition must be false.
Technically only 1 condition is evaluated inside an if , what is ascually happening is 1 condition gets evaluated and its result is evaluated with the next and so on...
The < c:if > tag is used for testing the condition and it display the body content, if the expression evaluated is true. It is a simple conditional tag which is used for evaluating the body content, if the supplied condition is true.
This look like a duplicate of JSTL conditional check.
The error is having the &&
outside the expression. Instead use
<c:if test="${ISAJAX == 0 && ISDATE == 0}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With