Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

java - Differences between EL 2.1 and 2.2

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...