Please send mail to

Java Standard EL Functions

Java Standard EL Functions(JSEL) provides standard EL functions for web application development.


Source code is available on Subversion repository on You can browse it using web browser at the following URL:

Subversion repository URL is:


Apache License, Version 2.0

How to Use


Put functions-x.x.x.jar into WEB-INF/lib and add following filter definition to your web.xml.



Add the following taglib directive to your JSP:

<%@ taglib uri="" prefix="f" %>
<%@ taglib uri="" prefix="log" %>

You can use EL functions which provided by JSEL:



A table of available EL functions are here:

Core Functions (

Function Description
f:h(String value) Escape HTML tags
f:u(String value) URL encode
f:br(String value) Convert line separator to <br>
f:nbsp(String value) Convert space to &nbsp;
f:cut(String value, int length)
f:link(String value) Convert URL to link
f:mask(String value) Convert String to astarisk
f:date(Date date) Format Date using date pattern
f:datetime(Date date) Format Date using datetime pattern
f:time(Date date) Format Date using time pattern
f:number(Object number, String pattern) Format number using given pattern
f:json(Object bean) Cpnvert object to JSON
f:query(Object params) Assemble query string from map's key and value
f:matches(String value, String pattern) Test whether value matches regex pattern
f:replace(String value, String pattern, String replacement) replace regex pattern in value with replacement
f:js(String value)
f:concat(Object value1, Object value2 Join value1 and value2
f:contains(Object value1, Object value2) Test whether value1 contains value2

Log Functions (

Function Description
log:trace(Object message) Output log as TRACE level
log:debug(Object message) Output log as DEBUG level
log:info(Object message) Output log as INFO level
log:warn(Object message) Output log as WARN level
log:error(Object message) Output log as ERROR level
log:fatal(Object message) Output log as FATAL level
log:printTrace(Object message) Displays message if TRACE log is enabled
log:printDebug(Object message) Displays message if DEBUG log is enabled
log:printInfo(Object message) Displays message if INFO log is enabled
log:printWarn(Object message) Displays message if WARN log is enabled
log:printError(Object message) Displays message if ERROR log is enabled
log:printFatal(Object message) Displays message if FATAL log is enabled
log:isTraceEnabled() Tests whether TRACE log is enabled
log:isDebugEnabled() Tests whether DEBUG log is enabled
log:isInfoEnnabled() Tests whether INFO log is enabled
log:isWarnEnabled() Tests whether WARN log is enabled
log:isErrorEnabled() Tests whether ERROR log is enabled
log:isFatalEnabled() Tests whether FATAL log is enabled

These functions output log using Log4j. Logger name is decided by the following rules.

  • Gets servlet path using HttpServletRequest#getServletPath()
  • Removes the first / and the last .jsp from servlet path
  • Replaces / to . in jsp.<servlet path> and it would be a logger name

For example, /index.jsp is jsp.index, /admin/index.jsp is jsp.admin.index. Define appenders which are applied to these loggers in your or log4j.xml.


Some EL functions such as f:date()、f:datetime()、f:time() have default format pattern. If you want to customize these patterns, create and put into classpath root as the following contents.

# Charset of URL encoding which used by f:u()

# Format pattern of f:date()

# Format pattern of f:datetime()
datetimePattern=yyyy/MM/dd HH:mm:ss

# Format pattern of f:time()

Default is contained by functions-x.x.x.jar.


You can get JSEL from Maven repository which is provided by Project Amateras. Add the following fragment to your pom.xml.

    <name>Project AMateras Maven2 Repository</name>


 1.1.2 - 2011/01/19

  • f:contains() supports Array.
  • Fixed a problem of functions.tld.

 1.1.1 - 2010/09/30

  • Add functions to print message to JSP by log level such as log:printTrace().
  • Add functions to test whether log level is enabled such as log:isTraceEnabled().

 1.1.0 - 2010/03/16

  • Add FunctionsFilter. This filter is required to use a part of JSEL features.
  • Add f:json()、f:query()、f:matches()、f:replace()、f:js()、f:concat()、f:contains().
  • Add Log4j functions such as log:trace().
  • Add $context variable which available on JSP

 1.0.0 - 2010/01/30

Initial Release.