String functions in JSF EL (JSF Expression Language)

Add JSTL functions namespace in Facelets XHTML:




Example 2:
<c:forEach items="${contacts}" var="contact">
   <c:if test="${not fn:containsIgnoreCase(contact, '')}">       
<p>Doesn't contain ''</p> </c:if> 
Other functions:
  • toUpperCase, toLowerCase: Changes the capitalization of a string
  • substring, substringBefore, substringAfter: Gets a subset of a string
  • trim: Trims white space from a string
  • replace: Replaces characters in a string
  • indexOf, startsWith, endsWith, contains, containsIgnoreCase: Checks whether a string contains another string
  • split: Splits a string into an array
  • join: Joins a collection into a string
  • escapeXml: Escapes XML characters in a string
  • length: Returns the number of items in a collection, or the number of characters in a string
See also:

Featured Post

NGINX Unit is dynamically configured using a REST API

There is no static configuration file. All configuration changes happen directly in memory. Configuration changes take effect without requir...