JSTL 1.1 functions libraryJSTL functions1.1fnhttp://java.sun.com/jsp/jstl/functions
Tests if an input string contains the specified substring.
containsorg.apache.taglibs.standard.functions.Functionsboolean contains(java.lang.String, java.lang.String)
<c:if test="${fn:contains(name, searchString)}">
Tests if an input string contains the specified substring in a case insensitive way.
containsIgnoreCaseorg.apache.taglibs.standard.functions.Functionsboolean containsIgnoreCase(java.lang.String, java.lang.String)
<c:if test="${fn:containsIgnoreCase(name, searchString)}">
Tests if an input string ends with the specified suffix.
endsWithorg.apache.taglibs.standard.functions.Functionsboolean endsWith(java.lang.String, java.lang.String)
<c:if test="${fn:endsWith(filename, ".txt")}">
Escapes characters that could be interpreted as XML markup.
escapeXmlorg.apache.taglibs.standard.functions.Functionsjava.lang.String escapeXml(java.lang.String)
${fn:escapeXml(param:info)}
Returns the index withing a string of the first occurrence of a specified substring.
indexOforg.apache.taglibs.standard.functions.Functionsint indexOf(java.lang.String, java.lang.String)
${fn:indexOf(name, "-")}
Joins all elements of an array into a string.
joinorg.apache.taglibs.standard.functions.Functionsjava.lang.String join(java.lang.String[], java.lang.String)
${fn:join(array, ";")}
Returns the number of items in a collection, or the number of characters in a string.
lengthorg.apache.taglibs.standard.functions.Functionsint length(java.lang.Object)
You have ${fn:length(shoppingCart.products)} in your shopping cart.
Returns a string resulting from replacing in an input string all occurrences
of a "before" string into an "after" substring.
replaceorg.apache.taglibs.standard.functions.Functionsjava.lang.String replace(java.lang.String, java.lang.String, java.lang.String)
${fn:replace(text, "-", "")}
Splits a string into an array of substrings.
splitorg.apache.taglibs.standard.functions.Functionsjava.lang.String[] split(java.lang.String, java.lang.String)
${fn:split(customerNames, ";")}
Tests if an input string starts with the specified prefix.
startsWithorg.apache.taglibs.standard.functions.Functionsboolean startsWith(java.lang.String, java.lang.String)
<c:if test="${fn:startsWith(product.id, "100-")}">
Returns a subset of a string.
substringorg.apache.taglibs.standard.functions.Functionsjava.lang.String substring(java.lang.String, int, int)
P.O. Box: ${fn:substring(zip, 6, -1)}
Returns a subset of a string following a specific substring.
substringAfterorg.apache.taglibs.standard.functions.Functionsjava.lang.String substringAfter(java.lang.String, java.lang.String)
P.O. Box: ${fn:substringAfter(zip, "-")}
Returns a subset of a string before a specific substring.
substringBeforeorg.apache.taglibs.standard.functions.Functionsjava.lang.String substringBefore(java.lang.String, java.lang.String)
Zip (without P.O. Box): ${fn:substringBefore(zip, "-")}
Converts all of the characters of a string to lower case.
toLowerCaseorg.apache.taglibs.standard.functions.Functionsjava.lang.String toLowerCase(java.lang.String)
Product name: ${fn.toLowerCase(product.name)}
Converts all of the characters of a string to upper case.
toUpperCaseorg.apache.taglibs.standard.functions.Functionsjava.lang.String toUpperCase(java.lang.String)
Product name: ${fn.UpperCase(product.name)}
Removes white spaces from both ends of a string.
trimorg.apache.taglibs.standard.functions.Functionsjava.lang.String trim(java.lang.String)
Name: ${fn.trim(name)}
<%@page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.net.URLDecoder"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>