ViewScoped « Control « JSF Q&A





1. @ViewScoped and dynamically included fragments    stackoverflow.com

I have a JSF page that uses a field on my UI bean to include content as follows:

...
<ui:include src="#{MyBean.status}.xhtml"/>
...
MyBean has the @ViewScoped annotation and the value of the status property will ...

2. JSF 2: ViewScoped vs @RequestScoped    stackoverflow.com

My bean has this:

@ManagedBean
@ViewScoped
public class BookBean implements Serializable
{       
    @ManagedProperty(value = "#{param.id}") // does not work with @ViewScoped
    private ...

3. JSF 2.0 ViewScoped life cycle    stackoverflow.com

My problem is that one of my ViewScoped bean is created several time within the same view. The constructor of ViewScopedBean is created every time I select a node in the ...

5. @ViewScoped not working    coderanch.com

It's a fundamental JSF principal that you cannot inject a short-scoped object into a longer-scoped one. In particular, you cannot inject Request-scope objects into Session-scoped ones. ViewScope is a variant of Session Scope with a longer lifespan than Request Scope and a shorter lifespan than full Session Scope. ViewScope objects can therefore only be injected with View, Session, and/or Application scope ...