Standard Tag Library JSTL (JSP Standards Tag libraries)

Source: Internet
Author: User
Tags control label

1, core tag (most commonly used, most important)
Expression Control label
Out
Output constants
Value---Direct assignment
Output variables
Default---Defaults
EscapeXML---Control of the escape character (default is true, set to False if escaping is required)
Set
Three properties: var value scope---Save a value to *scope (default is PageContext)
Values can be placed after value, or in the middle of two tags
<c:set var= "T" value= "Shandong Zibo"/>
<c:set var= "T1" > Anhui Huangshan </c:set>
Target corresponds to the name value of the JavaBean
Property corresponds to the attribute within the defined class
Remove----can only be used for variable removal within a page
To remove a variable
var: Specifies the name of the variable that needs remove
Scope: Two variables in scope the name of the variable is repeated, you can use this property to determine which is removed
Catch
Equivalent to Try...catch ...
You can put other tags in this tag, only one property var
Process Control Labels
If
<c:if test= "El expression" var= "variable name" scope= "" ></c:if>
Choose---The following three tags are commonly used together, similar to switch
When
otherwise--can not write
Loop control label
Foreach
var: sets a variable value to store the values traversed from the array or collection
Items: Specify the array or collection to traverse
Begin, End: Specifies the starting position to traverse
Step: The number of skipped per traversal, the default value is 1
Varstatus: By index (the indexed value in the original collection), count (current number of), first (whether it is the second), last (whether it is the final), to describe the state of the Begin and End Sub-sets
Note First and last, is the judgment whether in the output results of the initial or final, not the original set
Fortokens (recall the Split () method of the string)
The results of the output also have index, count, first, last of these four properties
URL Action Label
Import
The content of another page is introduced to this page, the difference from the include directive: This tag can be introduced into other projects or even resources on the network
<c:import
Url= "The path to be imported (can write network resources, can write local files)"
Context= "Other items under the same server must start with '/'
Var= "depositing the contents of a contained file as a string type"
Scope= "Four scopes"
charencoding= "encoded format of the file being imported"
Varreader= "store imported files as Reader type" ></c:import>
Url
Typically used to dynamically generate hyperlinks
<c:url value= "https://www.baidu.com" var= "Newurl" ></c:url>
<a href= "${newurl}" > New url</a>
redirect
Page redirection
<c:redirect url= "redirected pages" >
<c:param name= "username" >admin</c:param>
<c:param name= "Password" >123456</c:param>
</c:redirect>
2, formatting tags
3, SQL tab
4, XML tag
5, Jstl function
Contains
Startwith
Endwith
EscapeXML

Standard Tag Library JSTL (JSP Standards Tag libraries)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.