【发布时间】:2011-01-27 16:56:03
【问题描述】:
我正在开发一个 Java EE 5 的 Web 应用程序。我可能会在某个时候将它升级到 EE 6,但目前还不能。 Web 应用程序在 Tomcat 6 中运行。我可以使用 CDI 吗?
我注意到Weld documentation 中有一条说明我不能使用会话bean:
There is a major limitation to using a servlet container. Weld doesn't support deploying session beans, injection using @EJB or @PersistenceContext, or using transactional events in servlet containers. For enterprise features such as these, you should really be looking at a Java EE application server.
这是否意味着我不能使用@SessionScoped 注释?如果是这样,那将是目前使用 CDI 的障碍。
有什么想法吗?谢谢。
【问题讨论】:
标签: java tomcat jakarta-ee tomcat6 cdi