简体   繁体   English

EL 2.1和2.2之间的差异

[英]Differences between EL 2.1 and 2.2

I am looking for list of differences between EL 2.1 and 2.2. 我正在寻找EL 2.1和2.2之间的差异列表。

I know one difference between EL 2.1 and 2.2 is ability to pass method parameters in 2.2. 我知道EL 2.1和2.2之间的一个区别是能够在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. 答案在EL 2.2中。 specification document. 规范文件。 Here's an extract of relevance: 这是相关的摘录:

A.1 Changes between Maintenance 1 and Maintenance Release 2 A.1维护1和维护版本2之间的更改

The main change in this release is the addition of method invokations with parameters in the EL, such as #{trader.buy("JAVA")} . 此版本中的主要更改是在EL中添加了带参数的方法调用,例如#{trader.buy("JAVA")}

  • Added one method in javax.el.ELResolver : javax.el.ELResolver添加了一个方法:
    • Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) . Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)

  • Added one method in javax.el.BeanELResolver : javax.el.BeanELResolver添加了一个方法:
    • Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) . Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)

  • Added one method in javax.el.CompositeELResolver : javax.el.CompositeELResolver添加了一个方法:
    • Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) . Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)

  • Section 1.1.1. 第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. 第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. 在评估时,EL API验证该方法是否符合在分析时提供的预期签名。 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. 在评估时,如果在解析时提供预期签名,则EL API验证该方法是否符合预期签名,因此不执行强制。 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. 第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. 第1.19节。 Production of ValueSuffix includes the optional parameters. ValueSuffix包括可选参数。

No other changes are mentioned. 没有提到其他变化。 So, it's indeed just only the method invocation capability. 所以,它确实只是方法调用功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM