Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

tag

tag

JSP Standard Label LibraryJSP Standard Tag Library

The tag evaluates an expression and executes its body content if the expression's value is true.

Syntax format





   ...



property

The tag has the following attributes:

property Description Whether it is required Default value
test Conditional Is None
var The variable used to store the result of the condition No None
scope The scope of the var attribute No page

Demo Example



<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>





c:if 标签实例









   

我的工资为:

The running result is as follows:



我的工资为: 4000


JSP Standard Label LibraryJSP Standard Tag Library