質問

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