语法花样:
<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内里输出的细致内容,更多请关注ki4网别的相干文章!