Migrate JSF managed beans to CDI managed beans

Viewed 2841

I'm planning to convert a web app from using JSF managed bean to using CDI managed beans. I know I'll need to do below:

  1. Add a empty beans.xml file in WEB-INF.
  2. Replace all JSF @ManagedBean to CDI @Named annotations.
  3. Replace all JSF scope annotations with CDI or OmniFaces scope annotations.
  4. Replace all JSF @ManagedProperty with CDI @Inject annotations.

Is that all that needs to be done? Are there any gotchas that I need to be aware of?

1 Answers
Related