Jstl function Tag library fn label

Source: Internet
Author: User

Before using the JSTL function tag library, you need to introduce it in the page:

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

1, Fn:contains (string, substring)
Returns true if the parameter string contains the parameter substring.

2, Fn:containsignorecase (string, substring)
Returns true if the parameter string contains the parameter substring (ignoring case)

3, Fn:endswith (string, suffix)
Returns true if the argument string ends with the argument suffix.

4, Fn:escapexml (String)
Convert XML (and HTML) that has special meaning to the corresponding XML character entity code, and return.

5, Fn:indexof (string, substring)
Returns the position of the first occurrence of the parameter substring in the parameter string.

6, Fn:join (array, separator)
Separator a given array array together with the given spacer, forming a new string and returning it.

7. Fn:length (item)
Returns the number of elements contained in the parameter item. The parameter item type is an array, a collection, or a string. If it is of type string, the return value is the number of characters in string.

<Body>             <%          Stringa[]= {"AA","BB","cc","DD"}; Request.setattribute ("Array", a); Request.setattribute ("Store","guomei8899"); %>       <c:ifTest= "${fn:contains (' guomeiddd ', ' Guomei ')}">Ok</c:if><BR>      <c:ifTest= "${fn:containsignorecase (store, ' Guomei ')}">Ok OK</c:if><BR>      <c:ifTest= "${fn:endswith (store, ' the '")} ">End</c:if><BR>      <C:outvalue= "${fn:escapexml (' <> ')}"/><BR>      <C:outvalue= "${fn:indexof (store, ' Om ')}"/><BR>      <C:outvalue= "${fn:join (array, ' | ')}"/><BR>      <C:outvalue= "${fn:length (Array)}"/><BR>  </Body> 

8, Fn:replace (string, before, after)
Returns a String object. Replaces all occurrences of a parameter before string in a parameter string with a parameter after string, and returns the replaced result.

9, Fn:startswith (string, prefix)
Returns true if the argument string starts with the parameter prefix.

10, fn:substring (string, begin, end)
Returns a string part of the argument string, starting with the argument begin to the argument end position.

11, Fn:substringafter (string, substring)
Returns the part of the string that the parameter substring follows in the argument string.

12, Fn:substringbefore (string, substring)
Returns the part of the string that precedes the argument substring in the argument string.

13, Fn:tolowercase (String)
Converts all characters of the argument string to lowercase and returns it.

14, Fn:touppercase (String)
Converts all characters of the argument string to uppercase and returns it.

15, Fn:trim (String)
Strips the argument string from the end of the space and returns it.

<Body>             <%          Stringa[]= {"AA","BB","cc","DD"}; Request.setattribute ("Array", a); Request.setattribute ("Store","guomei8899"); Request.setattribute ("User","U1,u2,u3,u4,u5"); Request.setattribute ("Test","ABcDeF"); %>       <C:outvalue= "${fn:replace (store, ' 8 ', ' 9 ')}"/><BR>      <C:outvalue= "${fn:split (user, ', ')}"/><BR>      <C:outvalue= "${fn:startswith (store, ' G ')}"/><BR>      <C:outvalue= "${fn:substring (store,2,5)}"/><BR>      <C:outvalue= "${fn:substringafter (store, ' Mei ')}"/><BR>      <C:outvalue= "${fn:substringbefore (store, ' Mei ')}"/><BR>      <C:outvalue= "${fn:tolowercase (test)}"/><BR>      <C:outvalue= "${fn:touppercase (test)}"/><BR>      <C:outvalue= "${test}hoho"/><BR>      <C:outvalue= "${fn:trim (test)}hoho"/><BR>  </Body>  

Jstl function Tag library fn label

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.