Summary of JSTL Standard functions

Source: Internet
Author: User

Jstl Standard Functions

The declaration of a standard function must be introduced in the JSP before using these functions

<%@ taglib prefix= "FN" uri= "Http://java.sun.com/jsp/jstl/functions"%>

The following is a list of the methods that are in JSTL and their descriptions

Name of function

Function description

Examples of Use

Contains

Determine if a string contains another string

<c:if test= "${fn:contains (name, SearchString)}" >

Containsignorecase

Determines whether a string contains another string ( case -insensitive )

<c:if test= "${fn:containsignorecase (name, SearchString)}" >

EndsWith

Determines whether a string ends with a different string

<c:if test= "${fn:endswith (filename,". txt ")}" >

EscapeXML

Turn some characters into XML representations, such as < characters should be converted to <

${fn:escapexml (Param:info)}

IndexOf

The position where the substring appears in the parent string

${fn:indexof (Name, "-")}

Join

Unites the data in the array into a new string and uses the specified character format to open the

${fn:join (Array, ";")}

Length

Gets the length of the string, or the size of the array

${fn:length (Shoppingcart.products)}

Replace

Replace the character specified in the string

${fn:replace (Text, "-", "?")}

Split

Segmentation the string according to the specified word

${fn:split (Customernames, ";")}

StartsWith

Determines whether a string starts with a substring

<c:if test= "${fn:startswith (product.id," 100-")}" >

Substring

Get child string

${fn:substring (Zip, 6,-1)}

Substringafter

Gets the substring starting at the location of a character

${fn:substringafter (Zip, "-")}

Substringbefore

Gets the substring from the beginning to the location of a character

${fn:substringbefore (Zip, "-")}

toLowerCase

Convert to lowercase

${fn.tolowercase (Product.name)}

toUpperCase

Convert to uppercase characters

${fn. Uppercase (Product.name)}

Trim

Remove spaces before and after a string

${fn.trim (name)}

Copyright NOTICE: Welcome reprint, Hope in your reprint at the same time, add the original address, thank you with

Summary of JSTL Standard functions

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.