Differences between EL 2.1 and 2.2
Asked Answered
B

1

4

I am looking for list of differences between EL 2.1 and 2.2.

I know one difference between EL 2.1 and 2.2 is ability to pass method parameters in 2.2. Are there any other differences?

Is there any feature comparison chart available for the differences? I have been searching for a few days and haven't been able to locate it so far.

Thank you

Blackface answered 26/8, 2011 at 9:28 Comment(0)
G
6

The answer is in the EL 2.2. specification document. Here's an extract of relevance:

A.1 Changes between Maintenance 1 and Maintenance Release 2

The main change in this release is the addition of method invokations with parameters in the EL, such as #{trader.buy("JAVA")}.

  • Added one method in javax.el.ELResolver:
    • Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params).

  • Added one method in javax.el.BeanELResolver:
    • Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params).

  • Added one method in javax.el.CompositeELResolver:
    • Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params).

  • Section 1.1.1. Added to the first paragraph:

    Simlarly, . operator can also be used to invoke methods, when the method name is known, but the [] operator can be used to invoke methods dynamically.

  • Section 1.2.1. Change the last part of the last paragraph from

    Upon evaluation, the EL API verifies that the method conforms to the expected signature provided at parse time. There is therefore no coercion performed.

    to

    Upon evaluation, if the expected signature is provided at parse time, the EL API verifies that the method conforms to the expected signature, and there is therefore no coercion performed. If the expected signature is not provided at parse time, then at evaluation, the method is identified with the information of the parameters in the expression and the parameters are coerced to the respective formal types.

  • Section 1.6. Added syntax for method invocation with parameters. The steps for evaluation of the expression was modified to handle the method invocations with parameters.

  • Section 1.19. Production of ValueSuffix includes the optional parameters.

No other changes are mentioned. So, it's indeed just only the method invocation capability.

Gnawing answered 26/8, 2011 at 18:44 Comment(1)
There was a small other change; the introduction of the ValueReference type and a getter for this on ValueExpression. See jcp.org/aboutJava/communityprocess/maintenance/jsr245/…, docs.oracle.com/javaee/7/api/javax/el/ValueReference.html and docs.oracle.com/javaee/7/api/javax/el/ValueExpression.html (notice the "Since EL 2.2")Circumstantiality

© 2022 - 2024 — McMap. All rights reserved.