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 sets a variable to the value of an XPath expression.

If the value of the XPath expression is of type boolean, thewill set a java.lang.Boolean object; if it is a string, a java.lang.String object will be set; if it is a number, a java.lang.Number object will be set.

Syntax format



property

The tag has the following attributes:

property Description Whether it is required Default value
var The variable representing the value of the XPath expression Is Body
select The XPath expression to evaluate No None
scope The scope of the var attribute No Page

Example Demonstration

The following example shows us how to use thetags:



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

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







  JSTL x:set 标签





Books Info:

Padam History ZARA 100 Great Mistry NUHA 2000 The price of the second book:

The running result is as follows:



BOOKS INFO:

The price of the second book:[[book: null], [book: null]]


JSP Standard Label LibraryJSP Standard Tag Library