The JavaServer Pages Standard Tag Library (JSTL) provides
expressions for common web application functionalities. Though JavaServer Faces Expression Language (EL)
is different from JSTL expressions, the two can be used in combination for functional
for which it makes sense. For example, the table below lists JSTL expressions
that operate on String values.
Function | Description |
fn:contains() | Tests if an input string |
fn:containsIgnoreCase() | Tests if an input string contains the specified |
fn:endsWith() | Tests if an input string |
fn:escapeXml() | Escapes characters that could be interpreted as XML |
fn:indexOf() | Returns the index withing a |
fn:length() | Returns the number of items in a collection, or the |
fn:replace() | Returns a string resulting |
fn:startsWith() | Tests if an input string starts with the specified |
fn:substring() | Returns a subset of a |
fn:substringAfter() | Returns a subset of a string following a specific |
fn:substringBefore() | Returns a subset of a string |
fn:toLowerCase() | Converts all of the characters of a string to lower |
fn:toUpperCase() | Converts all of the |
fn:trim() | Removes white spaces from both ends of a string. |
Src: http://www.tutorialspoint.com/jsp/jsp_standard_tag_library.htm
To use JSTL in Oracle ADF Faces component EL references, you
need to add the JSTL namespace of the tags you want to reference. For the JSTL functions
shown in the table above, you need to manually add the name space highlighted in
red to the JSPX document or page fragment.
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
The value expression below, referenced in an af:outputText
component, displays the substring (first, second and third character) for a
value read from the ADF binding layer.
<af:outputText value="#{fn:substring(bindings.employeeName.inputValue,1,3)}"
id="ot7"/>