tag
Syntax format
property
| property | Description | Whether it is required | Default value |
|---|---|---|---|
| select | The XPath expression to evaluate | Is | None |
| var | The variable used to store the current item | No | None |
| begin | The start index of the iterator | No | None |
| end | The end index of the iterator | No | None |
| step | The step of the iteration | No | None |
| varStatus | The variable representing the status stored by the iterator | No | None |
Example Demonstration
<%@ 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:forEach 标签
Books Info:
Padam History
ZARA
100
Great Mistry
NUHA
2000
- Book Name:
The running result is as follows:
BOOKS INFO:
Book Name: Padam History
Book Name: Great Mistry
JSP Standard Tag Library