jstl標籤 函式

2021-09-01 02:15:55 字數 1562 閱讀 1779

[color=red][align=center][size=large]jstl標籤,fn函式[/size][/align][/color]

[size=medium]函式:fn:contains(string, substring)

描述: 如果引數string中包含引數substring,返回true

函式:fn:containsignorecase(string, substring)

描述:如果引數string中包含引數substring(忽略大小寫),返回true

函式:fn:endswith(string, suffix)

描述:如果引數 string 以引數suffix結尾,返回true

函式:fn:escapexml(string)

描述:將有特殊意義的xml (和html)轉換為對應的xml character entity code,並返回

函式:fn:indexof(string, substring)

描述:返回引數substring在引數string中第一次出現的位置

函式:fn:join(array, separator)

描述:將乙個給定的陣列array用給定的間隔符separator串在一起,組成乙個新的字串並返回。

函式:fn:length(item)

描述:返回引數item中包含元素的數量。引數item型別是陣列、collection或者string。如果是string型別,返回值是string中的字元數。

函式:fn:replace(string, before, after)

描述:返回乙個string物件。用引數after字串替換引數string中所有出現引數before字串的地方,並返回替換後的結果

函式:fn:split(string, separator)

描述:返回乙個陣列,以引數separator 為分割符分割引數string,分割後的每一部分就是陣列的乙個元素

函式:fn:startswith(string, prefix)

描述:如果引數string以引數prefix開頭,返回true

函式:fn:substring(string, begin, end)

描述:返回引數string部分字串, 從引數begin開始到引數end位置,包括end位置的字元

函式:fn:substringafter(string, substring)

描述:返回引數substring在引數string中後面的那一部分字串

函式:fn:substringbefore(string, substring)

描述:返回引數substring在引數string中前面的那一部分字串

函式:fn:tolowercase(string)

描述:將引數string所有的字元變為小寫,並將其返回

函式:fn:touppercase(string)

描述:將引數string所有的字元變為大寫,並將其返回

函式:fn:trim(string)

描述:去除引數string 首尾的空格,並將其返回

例子:要取到網域名稱abcd.com.cn的字尾cn

$[/size]

jstl標籤庫 函式

jsp標準標籤庫 jstl 是乙個jsp標籤集合,它封裝了jsp應用的通用核心功能。jstl支援通用的 結構化的任務,比如迭代,條件判斷,xml文件操作,國際化標籤,sql標籤。除了這些,它還提供了乙個框架來使用整合jstl的自定義標籤。根據jstl標籤所提供的功能,可以將其分為5個類別。核心標籤 ...

JSTL 核心標籤

cccccccccccccc map map new hashmap request.setattribute map map person p new person request.setattribute person p session.setattribute date 2011 date被...

小議jstl標籤 c標籤

jstl是在jsp頁面引用的一種使用簡單但是功能非常強大的標籤。我們在專案中用到的最多的就是jstl中的c標籤了,這裡簡單的說明一下。1 在web容器裡面裝入 c.tld 2 在web.xml宣告,宣告如下 core lib tld c.tld 3 在頁面的頁頭載入標籤,載入方式如下 taglib ...