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

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.

主站蜘蛛池模板: 阿图什市| 东阳市| 察哈| 六枝特区| 潍坊市| 潮州市| 开远市| 全南县| 武冈市| 洱源县| 永靖县| 万宁市| 师宗县| 漠河县| 莆田市| 新竹县| 桂平市| 紫金县| 阜康市| 屏南县| 富民县| 土默特右旗| 星座| 咸宁市| 潮安县| 绍兴县| 固原市| 米林县| 兴业县| 夏邑县| 吉首市| 进贤县| 海淀区| 益阳市| 固阳县| 巴林右旗| 开原市| 察隅县| 焉耆| 潜山县| 蓬溪县|