tag
Syntax format
...
property
| property | Description | Whether it is required | Default value |
|---|---|---|---|
| select | The XPath expression to evaluate | Is | None |
| var | The variable that stores the result of the condition | No | None |
| scope | The scope of the var attribute | No | Page |
Example Demonstration
The following example shows us how to use the
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
JSTL x:if 标签
Books Info:
Padam History
ZARA
100
Great Mistry
NUHA
2000
Document has at least one element.
Book prices are very high
The running result is as follows:
BOOKS INFO:
Document has at least one element.
Book prices are very high
JSP Standard Tag Library