jsr341-experts@el-spec.java.net

[jsr341-experts] Making #{ and } optional

From: Kin-man Chung <kinman.chung_at_oracle.com>
Date: Thu, 18 Aug 2011 13:48:41 -0700

When evaluating EL expression in ELProcessor, writing the expressions
bracketed by #{ and } seems redundant, especially since ${ is treated
the same as a #{. I think we can write

     elProcessor.getValue("foo.bar");

instead of

     elProcessor.getValue("#{foo.bar}");

The only thing this would be a problem is the composite expressions, such as

     "abc#{foo.bar}xyz#{foo.baz}"

So my proposal is the following.

==============
If the parameter "expressions" in ELProcessor.getValue (or setValue,
setVariable) does not contain a #{ or ${, it is assumed to be brackedted
by a #{ and }.

For backward compatibility, the automatic bracketing is not applied to
the methods in ExpressionFactory.
==============

This is just another easy-of-use aspect for stand-alone EL.

WDYT?