InterviewSolution
| 1. |
Explain @ViewScoped, @SessionScoped, @CustomScoped and @RequestScoped annotations? |
|
Answer» @ViewScoped: -As long as the user is interacting with a similar JSF VIEW, the beans are alive. It is usually created on an HTTP request. The BEAN gets destroyed when the user post-backs to a different view. @SessionScoped:- Beans are there as long as HTTP session lives. This gets created with the first HTTP request. This bean is destroyed when the HTTP session is INVALIDATED. @CustomScoped:- This bean is there when it enters in the map of custom. It is created for a particular scope live. @RequestScoped: -Beans are there as long as the HTTP request-response lives. This usually gets created when an HTTP is requested. It gets destroyed when the HTTP request is over. |
|