Nov 7, 2017

The tag evaluates an expression and displays its body content only if the expression evaluates to true.


Attribute:

The <c:if> tag has following attributes:
AttributeDescriptionRequiredDefault
testCondition to evaluateYesNone
varName of the variable to store the condition's resultNoNone
scopeScope of the variable to store the condition's resultNopage
Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title><c:if> Tag Example</title>
</head>
<body>
<c:set var="i88ca" scope="session" value="${188}"/>
<c:if test="${i88ca > 2000}">
   <p>My test is: <c:out value="${i88ca}"/><p>
</c:if>
</body>
</html>

Post a Comment

Featured Post

Setup Chinese Input Method in Ubuntu 17.10 Artful

sudo apt install ibus-sunpinyin After either of those commands do not forget to restart the IBus daemon ibus restart You might need t...