Annotation Interface ViewScoped


The lifecycle of a ViewScoped component starts when the view is navigated to and ends when navigating to a different view or when the UI is closed.

Injection with this annotation will create a direct reference to the object rather than a proxy.

There are some limitations when not using proxies. Interceptors and decorators will not work. Circular referencing (that is, injecting A to B and B to A) will not work unless there is at least one proxy in between.

The sister annotation to this is the NormalViewScoped. Both annotations reference the same underlying scope, so it is possible to get both a proxy and a direct reference to the same object by using different annotations.