The value to be stored. No subject content
If the target attribute is specified, the property attribute also needs to be specified. You can modify the javabean object and Map object more often.
The name of the variable to be removed by var is none.
Scope to which the scope variable belongs: No. All scopes
The test condition is none.
The url of the page to be retrieved and introduced is none.
Var is used to store the variable "no Print to page" of the introduced text.
VarReader (optional) specifies whether the variable that provides the java. io. Reader object is null.
<% @ Taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
The above program will print the http://www.w3cschool.cc page
<C: forEach>Tags have the following attributes:
Property description required default value
Does the information about the items to be recycled exist?
Element starting with begin (0 = first element, 1 = second element) No 0
End: Last element (0 = first element, 1 = second element) No Last element
Step: step No 1 for each iteration
Var indicates the name of the variable of the current entry. No
VarStatus indicates the variable name in the loop status.
<c:forEach var="i" begin="1" end="5"> Item <c:outvalue="${i}"/><p></c:forEach>
<C: forTokens>A tag has similar attributes to a <c: forEach> tag. However, <c: forTokens> has another attribute:
Delims separator is none
<c:forTokens items="Zara,nuha,roshy" delims="," var="name"> <c:out value="${name}"/><p></c:forTokens>
<C: forEach> the items in the tag is a collection class object or array, while the items in the <c: forTokens> tag is a string
<C: url>Tags have the following attributes:
Property description required default value
Value Base URL is none
Context Local Network Application name no current application
Var indicates whether the variable name of the URL is printed to page.
Scope var attribute scope no Page
<C: url> the tag formats the URL as a string and stores it in a variable. This label will automaticallyRewrite URL. The var attribute is used to store formatted URLs. Note: If the value does not start with "/", the URL will not be overwritten automatically.
<C: url> A tag is only an optional method for calling the response. encodeURL () method. Its real advantage is that it provides appropriate URL encoding, including the parameters specified in <c: param>.
<C: param>Tag
<c:url value="/index.jsp" var="myURL"> <c:param name="trackingId" value="1234"/> <c:param name="reportType" value="summary"/></c:url><c:import url="${myURL}"/>
<C: redirect>The tag redirects the browser to a new URL by automatically rewriting the URL. It provides content-related URLs and supports the c: param tag.
Property description required default value
The target url is none.
Context followed by a local network application name no current application
Format tags
The JSTL format label is used to format and output text, date, time, and number.
Label description
<Fmt: formatNumber> Format a number with the specified format or precision
<Fmt: parseNumber> parses a string representing a number, currency, or percentage.
<Fmt: formatDate> Format the date and time in the specified style or mode.
<Fmt: parseDate> parses a string representing the date or time.
<Fmt: bundle> bind Resources
<Fmt: setLocale> Specified Region
<Fmt: setBundle> bind Resources
<Fmt: timeZone> specifies the time zone.
<Fmt: setTimeZone> specifies the time zone.
<Fmt: message> displays the resource configuration file information.
<Fmt: requestEncoding> sets the request character encoding.
SQL tag
The jstl SQL tag Library provides tags for interacting with relational databases (Oracle, MySQL, SQL Server, and so on.
Label description
<SQL: setDataSource> specifies the data source.
<SQL: query> run an SQL query statement
<SQL: update> run an SQL update statement
<SQL: param> set the parameters in the SQL statement to the specified value.
<SQL: dateParam> set the Date parameter in the SQL statement to the value of the specified java. util. Date object.
<SQL: transaction> provides nested database behavior elements in a shared database connection to run all statements in the form of one transaction.
XML tag
The jstl xml tag Library provides tags for creating and operating XML documents.
Before using the xml tag, you must copy the XML and XPath packages to your <Tomcat installation directory> \ lib:
Label description
<X: out> similar to <% =...>, but only used for XPath expressions
<X: parse> parse XML data
<X: set> set an XPath expression
<X: if> determines the XPath expression. if it is true, the content in the body is executed. Otherwise, the body is skipped.
<X: forEach> iterate nodes in XML documents
<X: choose> <x: when> and <x: otherwise> parent labels
<X: when> <x: choose> sub-tag used for condition Determination
<X: otherwise> <x: choose> is executed when <x: when> is set to false.
<X: transform> apply the XSL conversion to the XML document.
<X: param> and <x: transform> are used together to set the XSL style sheet.
JSTL Functions
JSTL contains a series of standard functions, most of which are common string processing functions.
Function Description
Fn: contains () test whether the input string contains the specified substring
Fn: containsIgnoreCase () test whether the input string contains the specified substring. It is case insensitive.
Fn: endsWith () test whether the input string ends with the specified suffix
Fn: escapeXml () skips characters that can be marked as XML characters
Fn: indexOf () returns the position where the specified string appears in the input string.
Fn: join () combines the elements in the array into a string and then outputs
Fn: length () returns the string length.
Fn: replace () replaces the specified position in the input string with the specified string and returns
Fn: split () separates the string with the specified separator and then forms an array of substrings and returns
Fn: startsWith () test whether the input string starts with the specified prefix
Fn: substring () returns the subset of the string.
Fn: substringAfter () returns the subset of the string after the specified substring.
Fn: substringBefore () returns the subset of the string before the specified substring.
Fn: toLowerCase () converts the characters in the string to lowercase letters.
Fn: toUpperCase () converts the characters in the string into uppercase letters.
Fn: trim () removes the leading blank character