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 is used to loop through the nodes of an XML document.

Syntax format



property

The tag has the following attributes:

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 Label LibraryJSP Standard Tag Library