2000}">
2000
."/> 2000}">
2000
.">
The if of JSTL is the
Grammar format:
<c:if test="<boolean>" var="<string>" scope="<string>"> ...</c:if>
Attributes
Description | Default value | ||
Example:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <title>c:if 标签实例</title> </head> <body> <c:set var="salary" scope="session" value="${2000*2}"/> <c:if test="${salary > 2000}"> <p>我的工资为: <c:out value="${salary}"/><p> </c:if> </body> </html>
Result:
我的工资为: 4000
The above is the detailed content of How to output jstl in if. For more information, please follow other related articles on the PHP Chinese website!