문제

I tried to convert managed Beans ManagedBeans to CDIBeans simply by including @Named and @XxxScoped from javax.entreprise.context package. Along with the two JAR files cdi-api-1.1-PRD.jar javax.inject-1.jar. But it seem to be not as simple as that.

  1. I wanted to know why?
  2. Why isn't the above mentioned process working?

Shouldn't CDI beans support functionalities of managed beans? Am I totally missing something here?

도움이 되었습니까?

해결책

At least add empty beans.xml file to META-INF/ or WEB-INF/ in your archive.
There are other things you may need to do but that depends on your runtime environment.
There's a nice config example for Tomcat

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