문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top