您好,欢迎访问一九零五行业门户网

jstl怎么在if里面输出

jstl的if就是<c:if>标签,那么如何在里面进行输出呢?下面让我们了解一下。
语法格式:
<c:if test="<boolean> var=<string> scope=<string>>   ...</c:if>
属性
<c:if>标签有如下属性:
属性 描述
是否必要 默认值
test  
条件
是 

var
用于存储条件结果的变量


scope
var属性的作用域

page
示例:
<%@ 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>
结果:                
我的工资为: 4000
以上就是jstl怎么在if里面输出的详细内容。
其它类似信息

推荐信息