[ Team LiB ] Previous Section Next Section

Functions

JSP EL allows you to use functions in expressions as well. These functions must be defined in custom tag libraries. As you will see soon, there are a number of handy functions built into the JSTL.

A function has the syntax ns:func(param1, param2, ...), where ns is the namespace of the function, func is the name of the function and param1 is the first parameter value. For example, the function fn:length, which is part of the JSTL library, returns the length of a string. You can use this function to determine the length of the query string with the following expression:


${fn:length(pageContext.request.queryString)}
    [ Team LiB ] Previous Section Next Section