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

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.

主站蜘蛛池模板: 南靖县| 临夏县| 寿宁县| 阿城市| 抚顺县| 即墨市| 名山县| 三台县| 徐闻县| 桦南县| 永济市| 博客| 彭州市| 徐州市| 中阳县| 丹巴县| 安徽省| 永年县| 梧州市| 红河县| 潮安县| 呼和浩特市| 嵩明县| 龙胜| 平湖市| 昂仁县| 鄂伦春自治旗| 古浪县| 鹰潭市| 类乌齐县| 运城市| 阿尔山市| 栾川县| 荆门市| 托克托县| 安化县| 惠东县| 剑阁县| 和平县| 河池市| 焦作市|