java – With ViewScoped leaving the new JSF specification, what scope to use now in my managed beans that used it using JSF 2.2?

Question:

I have a big question now with the appearance of JSF 2.2: What to do with my views and my old managed beans? How do I do it now (which scope to use) since I can't use scoped view anymore in a view that needs to keep some objects in memory between ajax requests?

Answer:

According to: http://jdevelopment.nl/jsf-22/#1087

It says that the @ViewScoped annotation in the javax.faces.bean.ViewScoped package must become deprecated, since the creation of the @ViewScoped annotation in the javax.faces.view.ViewScoped package.

This happens, given the adoption of an extension of the CDI, using the second annotation. If you don't use CDI, this annotation won't do any good.

Scroll to Top