JSTL functions Library

JSTL functions Library


Posted in : Java Posted on : April 11, 2012 at 7:05 PM Comments : [ 0 ]

In this tutorial you will learn about the JSTL functions.

JSTL functions Library

In this tutorial you will learn about the JSTL functions.

JSTL functions library provides various functions to commonly manipulate with the String, such as to find out the length, to replace a string etc.

To use the functions of JSTL functions library following taglib would be required to add on your JSP page :

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

Above written taglib is a standard syntax for using the JSTL functions library.

Functions of JSTL functions library can be classified on the basis on their functional area these are as follows :

Function Area Functions
Collection Length length
String manipulation contains, containsIgnoreCase, endsWith,
startsWith, indexOf, split, join, replace,
escapeXml, toUpperCase, toLowerCase,
substring, substringAfter,sbstringBefore,
trim.

The table above describes that each functions has its own work purpose i.e they are defined as according to their function area such as :

length : This function returns an integer value, this value may be the total characters of a string or the total items of a collection.

contains : This function is used for testing whether the specified substring is contained by the string or not.

containsIgnoreCase : This function is used for testing a specified substring into a string in a case insensitive way.

endsWith : This function is used for testing whether a string is ended with the specific suffix.

startsWith : This function is used for testing whether a string is started with the specific prefix.

indexOf : This function is used for finding out the index of the first occurrence of the specified substring.

split : This function is used for breaking a string into substrings array.

join : This function is used for joining an array elements into a string.

replace : This function is used for replacing a string with the other.

escapeXml : This function is used for escaping the characters that can be translated as XML.

toUpperCase : This function is used for changing all the characters from lower case to upper case.

toLowerCase : This function is used for changing all the characters from upper case to lower case.

substring : This function is used for finding out the subset of a string.

substringAfter : This function is used for finding out the substring after a specified string.

sbstringBefore : This function is used for finding out the substring before a specified string.

trim : This function is used for removing the white spaces.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics