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

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.

主站蜘蛛池模板: 顺平县| 龙岩市| 鄂托克前旗| 怀来县| 德昌县| 临安市| 普洱| 新源县| 钟祥市| 托克托县| 墨竹工卡县| 兴宁市| 吴江市| 灵山县| 通许县| 文昌市| 大埔区| 铜山县| 沂南县| 达孜县| 涞源县| 葫芦岛市| 高密市| 武冈市| 延安市| 玛纳斯县| 吉林省| 沙河市| 龙江县| 鄂伦春自治旗| 辽阳市| 宁武县| 银川市| 都兰县| 辛集市| 房产| 嘉义市| 青海省| 富源县| 玉山县| 武川县|