CDI/Weld with JEE5 and Tomcat6
I'm working on a web application that is Java EE 5. I may be able to upgrade it to EE 6 at some point, but can't at the moment. The web app is running in Tomcat 6. Can I use CDI with it?
I noticed in the Weld documentation that there is a note that I can't use session beans:
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 shoul开发者_运维知识库d really be looking at a Java EE application server.
Does this mean I can't use the @SessionScoped
annotation? If so, that would be a show-stopper for using CDI at the moment.
Any thoughts? Thanks.
This is about EJB session beans. You can use CDI with JSF in tomcat 6. Just follow the installation instructions for Weld.
精彩评论