JSR-223 与 JSR-241 - 脚本语言
如果我理解正确的话:
JSR -223:引入了 Java 中的脚本语言引擎,就是这样!您可以自由地使用您想要的任何脚本语言,例如:Groovy、Mozilla Rhino、PHP、Jython、Python 等。J2EE 的默认实现支持 JavaScript 作为脚本引擎,但您可以添加您喜欢的任何脚本语言。因此,这只是将用 Java 语言编写的类与用脚本语言编写的代码段连接起来(反之亦然)。我可以看到,这种集成的唯一好处是,与用 Java 编写相同的程序相比,脚本语言在编写程序时提供了简单性。
JSR 241:这是 JSR-223 的扩展,强调采用 Groovy 作为脚本语言,即如果您计划在 Java 应用程序(Web 或 Dekstop 应用程序)中使用脚本语言,请使用 Groovy.. 离开其他,因为 Groovy 更像 Java,并且其他脚本语言(如 Jython、Python、JavaScript 等)已被采用和修改以适应 Java,但自然的选择是 Groovy。
您能否对此进行更多说明,我的理解正确吗?
What is main difference between JSR-223 and JSR-241?
If I understood correctly:
JSR -223: introduces a scripting language engine in Java, thats it! You are free to use whatever scripting language you wants, for ex: Groovy, Mozilla Rhino, PHP, Jython, Python etc. Default implementation of J2EE supports JavaScript as scripting engine, but you can add any scripting language you like. So this was simply to connect the Classes written in Java language with piece of code written in Scripting language (or vice-versa). The only benefit of this integration, I could see is simplicity offered by scripting language in writing a program as compared to writing the same program in Java.
JSR 241: This is extension of JSR-223 and emphasize on adopting Groovy as scripting language, i.e. If you're planning to use scripting language in your Java application (Web or Dekstop apps), use Groovy.. leave others, because Groovy is more Java like and other scripting languages like Jython, Python, JavaScript etc have been adopted and modified to suit Java, but natural choice is Groovy.
Could you please throw some more light on this, and Is my understanding correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JSR 241 不是 JSR 223 的扩展,也不是“强调采用 Groovy”。相反,它的主要重点是首先使 Groovy(即它的语法和语义)成为官方 Java 标准。
它与 JSR 223 唯一相关的是,它在 2.6 中被提及,以澄清为什么 JSR 223 尚未涵盖该提案:
JSR 241 is not an extension of JSR 223, nor does it "emphasize on adopting Groovy". Instead, its main focus is making Groovy (i.e. its syntax and semantics) an official Java standard in the first place.
The only thing it has to do with JSR 223 is that it's mentioned in 2.6 to clarify why the proposal is not already covered by JSR 223: