官术网_书友最值得收藏!

The none scope

The none scoped beans lives to serve other beans.

The none scope seems to be the black sheep of JSF scopes. Even its name doesn't inspire something useful. Practically, a managed bean in this scope lives as long as a single EL expression evaluation and is not visible in any JSF page. If the application scope lives the longest, this scope lives the shortest. But, if you inject the none scoped managed beans in other managed beans, then they will live as long as their hosts. Actually, this is their job, to serve other beans.

Note

The none scoped objects used in the configuration file indicate managed beans that are used by other managed beans in the application.

So, whenever you need a humble managed bean that is ready to be a part of a cool scope, such as a request or a session, you can annotate it with @NoneScoped, available in the javax.faces.bean package. Moreover, objects with the none scope can use other objects with the none scope.

主站蜘蛛池模板: 玛沁县| 肥乡县| 通许县| 福建省| 铁岭市| 习水县| 泰宁县| 德惠市| 临武县| 阿拉尔市| 仙桃市| 临洮县| 金山区| 潼关县| 孟村| 木兰县| 沁阳市| 蕉岭县| 迭部县| 大同县| 磴口县| 太湖县| 茌平县| 招远市| 荣昌县| 通江县| 汉沽区| 霍林郭勒市| 贵阳市| 温泉县| 伊宁市| 东乌| 龙陵县| 株洲市| 石台县| 元谋县| 望城县| 宁波市| 庆城县| 获嘉县| 基隆市|