什么是Weld,JSR-299? [英] What is Weld, JSR-299?

查看:110
本文介绍了什么是Weld,JSR-299?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现很多教程都显示了Weld代码示例,但没有介绍概述。

I've found lots of tutorials showing Weld code samples, but not an introductory overview.

您能否请一篇介绍性文章,或者回答以下问题:

Could you please suggest an introductory article, or answer the following:


  • Weld做什么/给你什么?

  • 它与Java EE 6有什么关系?

  • 如何在Java EE 6项目中使用它?

  • 如果在Java EE 6项目中使用它,那么取代它是什么,如果什么?

  • What does Weld do/give you?
  • How does it relate to Java EE 6?
  • How would one use it in a Java EE 6 project?
  • If one uses it in a Java EE 6 project, what is it supplanting, if anything?

推荐答案


Weld做什么/给你?

Weld 是摘要 JSR-299的参考实现API ,更好地称为CDI,上下文和依赖注入,这是一种通过 javax.enterprise.context javax.enterprise.inject 包。

Weld is the reference implementation of the abstract JSR-299 API, which is better known as CDI, Contexts and Dependency Injection, an API which is provided through javax.enterprise.context and javax.enterprise.inject packages.


它与Java EE 6有什么关系?

JSR-299是 Java EE 6(JSR-316)的一部分


如何在Java EE 6项目中使用它?

Java EE 6容器(应用程序服务器)已经提供了Weld或其他JSR-299实现。如果您的未附带Weld,但使用另一个JSR-299实现,并且您想要使用Weld,那么您需要查询有问题的容器的文档如何替换它。

Weld or another JSR-299 implementation is already supplied by the Java EE 6 container (the application server). If yours doesn't ship with Weld, but with another JSR-299 implementation, and you want to use Weld instead, then you need to consult the documentation of the container in question how to replace it.


如果在Java EE 6项目中使用它,那么它取代什么呢?

Spring(因为它是在黑暗的J2EE时代)。

Spring (as it was during the dark J2EE ages).

  • List of all (reference) implementations of JEE6
  • Introduction to Weld

这篇关于什么是Weld,JSR-299?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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