Video Demo
Demo of How the Price Calculator is Constructed with the Aid of JSTL Core <c:if> Tag.
JSTL Core Tag
To control the execution sequence within a JSP page, use the conditional JSTL Core <c:if> tag. When an expression is evaluated by the tag, the body of the tag is only included if the expression is determined to be true.
Syntax <c:if> tag
<c:if test="${expression}">
...
</c:if>
The test property, which identifies the expression to be assessed, is necessary. Any legal EL expression is acceptable. The tag’s body is included in the output if the expression returns true. If not, the tag’s body is ignored.
Several more properties are also supported by the c:if> tag, including:
- var: Creates a variable with the expression’s value.
- scope: Describes the variable’s range of application.
- varScope: Defines the parameters of the variable that the var attribute creates.
Contact Us