el-next@uel.java.net

Should FunctionMapper be deprecated?

From: Kin-man Chung <Kin-Man.Chung_at_Sun.COM>
Date: Wed, 17 Mar 2010 15:39:29 -0700

Current EL allows static functions to be invoked by the use of a
FunctionMapper. See java.el package in
http://java.sun.com/javaee/5/docs/api/

For instance, if the prefix "pre" and "foo" maps to the method
com.acme.bar.method, then the expression

     "#{pre:foo()}"

cuases this method to be invoked.

The need for both the prefix and a name, which can be unrelated
to the actual method name, is clunky and unintuitive, and has its
roots in JSP.

Since we already allow methods in EL expressions in EL 2.2, we should
extend this to include static methods. The most obvious syntax to use
is to include the package name, such as

     "#{com.acme.bar.method())"

The downside is that we are overloading the meaning of the . operator
here, and might cause problems in parsing. There may be other ways.

I'd assume we'd deprecate FunctionMapper and not include it in
ELProcessor.

-Kin-man