JSTL Function Tags

tutorial and example
tutorial and example

In JSTL, the purpose of function tags is similar to the various string methods in Java. Hence, these tag performs common string manipulation operations.

Functional tag is represented by following URL: –

Function Tags

These are some frequently used function tags: –

  • fn:length(): – This tag returns the length of the string i.e. number of characters present in the string.
  • fn:trim(): – This tag removes the spaces from both ends of the string.
  • fn:replace(): – This tag is used to replace one string with another.
  • fn:substring(): – This tag provides the substring (i.e. part of string) the string.
  • fn:join(): – This tag is used to concatenates separate strings of an array
  • fn:split(): – This tag breaks the string into array of substrings.
  • fn:contains(): – This tag checks whether the input string contains the specified substring.
  • fn:toUpperCase(): – This tag converts the lower case elements of a string into upper case.
  • fn:toLowerCase(): – This tag converts the upper case elements of a string into lower case.

Example of JSTL Function Tag

This is an example of JSTL Function tag that shows various JSTL function tags functionality.

index.jsp

Output: