Loading
 
What's Next: View All Tutorial →

JSTL Functions

Following are the tutorial links for useful JSTL functions with examples. Following Taglib directive should be included in the JSP page in order to use the JSTL functions. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jst...

Published Date: 30/08/2014  Last Modified Date: 30/08/2014    New Post



Following are the tutorial links for useful JSTL functions with examples. Following Taglib directive should be included in the JSP page in order to use the JSTL functions.

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  1. fn:contains function: This function checks whether the given string is present in the input as sub-string. It does a case sensitive check.
  2. fn:containsIgnoreCase(): It does a case insensitive check to see whether the provided string is a sub-string of input.
  3. fn:indexOf(): It is used for finding out the start position of a string in the provided string. Function returns -1 when string is not found in the input.
  4. fn:escapeXML(): It is used for HTML/XML character escaping which means it treats html/xml tags as a string. Similar to the escapeXml attribute of <c:out> tag.
  5. fn:join() and fn:split() functions: JSTL functions: fn:join() concatenates the strings with a given separator and returns the output string. fn:split() splits a given string into an array of substrings.
  6. fn:length(): The JSTL function fn:length() is used for computing the length of a string or to find out the number of elements in a collection. It returns the length of the object.
  7. fn:startsWith(): It checks the specified string is a prefix of given string.
  8. fn:endsWith(): fn:endsWith() JSTL function is used for checking the suffix of a string. It checks whether the given string ends with a particular string.
  9. fn:substring(): This JSTL function is used for getting a substring from the provided string.
  10. fn:substringAfter(): It is used for getting a substring which is present in the input string before a specified string.
  11. fn:substringBefore(): It gets a substring from input which comes after a specified string.
  12. fn:trim(): JSTL Function fn:trim() removes spaces from beginning and end of a string and function.
  13. fn:toUpperCase(): It is just opposite of fn:toLowerCase() function. It converts input string to a uppercase string.
  14. fn:toLowerCase(): This function is used for converting an input string to a lower case string.
  15. fn:replace(): fn:replace() function search for a string in the input and replace it with the provided string. It does case sensitive processing.
Awaiting for Administrator approval




← Back to list


Related Post




×