I have a CRUD application.. Where in the data is fetched, displayed n edited n stored back to db. Also there is a sequential access between pages & the information entered on the first page is needed on the second page & so forth. What would be the best scope & why ?
When to use which scope? What is the life-cycle of each scope.
Also, I couldn't find any good tutorial on scopes. If you are aware of the same, please guide.
Thanks, Shikha
There is a detailed explanation of JSF scopes in BalusC's excellent tutorial Communication in JSF 2.0.
As rule of thumb I would recommend to always choose the most narrow scope in order to reduce the state that is saved on the server side. Your application would have a bad scalability if you kept everything in session scope. The view scope is especially useful if you are working with ajax. For non-ajax views the request scope is often sufficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With