javax.faces.view.ViewScoped. The functionality of this corresponding annotation is identical to this one, but it is implemented as a CDI custom scope.
@Retention(value=RUNTIME) @Target(value=TYPE) @Inherited @Deprecated public @interface ViewScoped
When this annotation, along with
ManagedBean is found on a class, the runtime must act as if a
was declared for the corresponding managed bean.
ProjectStage is not
verify that the current
UIViewRoot does not have its
transient property set to
If so, add a
FacesMessage for the current
viewId to the
@ViewScoped beans cannot work if
the view is marked as transient. Also log a
message to the log. If
ProjectStage.Production, do not do this verification.
The bean must be stored in the map returned from
The runtime must ensure that any methods on the bean annotated with
PreDestroy are called when the scope begins
and ends, respectively. Two circumstances can cause the scope to end.
FacesContext.setViewRoot() is called with the new
being different than the current one.
The session, that happened to be active when the bean was created, expires. If no session existed when the bean was created, then this circumstance does not apply.
In the session expiration case, the runtime must ensure that
FacesContext.getCurrentInstance() returns a valid instance if it is
called during the processing of the
@PreDestroy annotated method. The
set of methods on
FacesContext that are valid to call in this
circumstance is identical to those documented as "valid to call this method
during application startup or shutdown". On the
returned from that
FacesContext, all of the methods documented as
"valid to call this method during application startup or shutdown" are valid
to call. In addition, the method
ExternalContext.getSessionMap() is also valid to call.
Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.