开发者

Differences between EL 2.1 and 2.2

I a开发者_如何学运维m 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜