EL 2.1和2.2之间的差异 [英] Differences between EL 2.1 and 2.2

查看:153
本文介绍了EL 2.1和2.2之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找EL 2.1和2.2之间的差异列表。

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

我知道EL 2.1和2.2之间的一个区别是能够在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.

谢谢

推荐答案

答案在 EL 2.2 。规范文件。以下是相关摘录:

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


A.1维护1和维护版本2之间的变化



此版本的主要变化是在EL中添加了
参数的方法调用,例如#{trader.buy(JAVA)}


  • javax.el.E​​LResolver 中添加了一个方法:


    • 对象调用(ELContext上下文,对象库,对象方法,类<?> []
      paramTypes,Object [] PARAMS)


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


      • 对象调用(ELContext上下文,对象库,对象方法,类<?> []
        paramTypes,Object [] params)



      • 对象调用(ELContext上下文,对象库,对象方法,类<?> []
        paramTypes,Object [] params)


      第1.1.1节。添加到第一段:

      Section 1.1.1. Added to the first paragraph:

      Simlarly,运算符也可用于调用方法,方法名称
      是已知的,但 [] 运算符可用于动态调用方法。

      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.

      第1.2.1节。更改最后一段的最后一部分

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

      评估后,EL API会验证该方法是否符合解析时提供的预期
      签名。因此没有强制执行。

      评估后,如果预期签名是在解析时提供的,EL API
      验证该方法是否符合预期的签名,因此
      没有执行强制。如果在解析时未提供预期签名,
      则在评估时,该方法将使用表达式中
      参数的信息进行标识,并且参数将强制转换为相应的
      正式类型。

      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.


    • 第1.19节。生产 ValueSuffix 包括可选参数。

    • 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.

      这篇关于EL 2.1和2.2之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆