Page 1 of 1

About Question enthuware.jwpv6.2.619 :

Posted: Thu Feb 16, 2012 8:57 pm
by Cengiz C.
Correction report

In explanation text first line ends like this:
.... In EL, a map's key-value pair can be accessed using either ${map.DBURL} or ${map.["DBURL"]).
Underlined

Code: Select all

${map.["DBURL"]}
is not valid EL.

And I'm ignoring the ) at the end which is obviously a typo.

Re: About Question enthuware.jwpv6.2.619 :

Posted: Fri Feb 17, 2012 10:21 am
by admin
You are right. It should be ${map["DBURL"]}.

As per EL Specification section 1.6:
The EL follows ECMAScript in unifying the treatment of the . and [] operators.
expr-a.identifier-b is equivalent to expr-a["identifier-b"]; that is, the
identifier identifier-b is used to construct a literal whose value is the identifier,
and then the [] operator is used with that value.
This should be fixed asap.

thank you for your feedback!