I have a problem with JSF, CDI project. I did a lot of research and I found that in CDI there is no @ViewedScoped
annotation. I solving problem with ajax based page with dialog. I want to pass variable to dialog from datatable. For this purpose, I can't use @RequestedScoped
bean because value is discard after end of request. Can anyone help me to solve it? I can't use @SessionScoped
but it's a bad practice IMHO. Or maybe save only this one variable into session who knows. Can you guys give me any hints how to solve this problem elegantly?
import javax.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class ServiceBean implements Serializable {
...
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class SomeBean {
@Inject
ServiceBean serviceBean;
@Postconstruct ...
Here is the error message:
com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean warDetailBean
@ViewedScoped
annotation." This was true only before Java EE 7. Java EE 7 (JSF 2.2) transparently supports a compatible view scope (fromjavax.faces.view.ViewScoped
) in flavour of the JSF view scope (fromjavax.faces.bean.ViewScoped
). – Tiny