![]() ![]() A good example of this might be a FileUpload bean that can be reused in multiple web applications. This type of bean provides some type of "utility" function to one or more JSF views. Utility Managed-Bean: Normally application scope.However, if the data applies to all users (such as a dropdown lists of provinces), then the bean would be kept in application scope, so that it can be cached for all users. If the data in the dropdown lists is particular to the user, then the bean would be kept in session scope. The typical use case is supplying an ArrayList to JSF h:selectOneMenu drop-down lists that appear in more than one JSF view. This type of bean "supports" one or more views in the "View" concern of the MVC design pattern. Support Managed-Bean: Normally session or application scope.JSF controller-beans typically have JSF action methods (and not actionListener methods). ![]() The purpose of a controller bean is to execute some kind of business logic and return a navigation outcome to the JSF navigation-handler. This type of managed-bean participates in the "Controller" concern of the MVC design pattern. Controller Managed-Bean: Normally request scope. ![]() JSF backing-beans may also have JSF actionListener and valueChangeListener methods. Although it typically has JavaBean-style properties with associated getters/setters, these are properties of the View - not of the underlying application data model. The purpose of a backing-bean is to support UI logic, and has a 1::1 relationship with a JSF view, or a JSF form in a Facelet composition. This type of managed-bean participates in the "View" concern of the MVC design pattern.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |