Himai Minh wrote:Hi, What is the difference between NoneScoped and RequestScoped?
According to Stackoverflow's comments, a none scoped bean lives as long as the EL expression is evaluated. But when the none scoped bean's EL expression is evaluated in one request/response, it has already gone through the lifecycle such as restore view, apply request, process validation, update model, invoke application , render response.
And a request scoped bean has to go through all the cycle in one request/response.
JSF spec 2.0's section 5.3.1 Managed Bean Configuration Example: This has an example of how a none scoped bean and a request scoped bean are configured and how they might be used together. To understand in detail you may have to write some code and verify the results. Here is the example:
A Customer bean with a request scope
An Address bean with none scope
The customer bean has attributes customer id, name, shipping address, billing address, etc. The shipping and billing address are of type Address. The customer bean creates an instance of address bean as shipping address and another instance as billing address; there will be two instances of address bean. The address bean instances do not have a scope, they are created as needed.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer