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

Optional faces-config.xml

Legacy J2EE applications suffered from what some have considered to be excessive XML configuration.

Java EE 5 took some measures to reduce XML configuration considerably. Java EE 6 reduced the required configuration even further, making the JSF configuration file, faces-config.xml, optional in JSF 2.0.

In JSF 2.0 and newer versions, JSF managed beans can be configured via the @ManagedBean annotation, obviating the need to configure them in faces-config.xml. Java EE 6 introduced the Contexts and Dependency Injection (CDI) API, which provides an alternate way of implementing functionality typically implemented with JSF managed beans. As of JSF 2.2, CDI named beans are preferred over JSF managed beans; JSF 2.3 went even further, deprecating specific JSF-managed beans in favor of CDI named beans.

Additionally, there is a convention for JSF navigation: if the value of the action attribute of a JSF 2.0 command link or command button matches the name of a facelet (minus the XHTML extension), then by convention, the application will navigate to the facelet matching the action name. This convention allows us to avoid having to configure application navigation in faces-config.xml.

For many modern JSF applications, faces-config.xml is completely unnecessary as long as we follow established JSF conventions.

主站蜘蛛池模板: 汉源县| 札达县| 新密市| 嘉鱼县| 仙游县| 二连浩特市| 蚌埠市| 陇南市| 美姑县| 江西省| 太谷县| 梧州市| 杭锦后旗| 武安市| 旬邑县| 尉氏县| 岳普湖县| 唐河县| 宜兰县| 宜章县| 乐至县| 灵丘县| 同仁县| 无极县| 大埔区| 遂昌县| 龙陵县| 沙湾县| 林芝县| 高雄市| 财经| 平和县| 凤冈县| 罗城| 恩平市| 盐边县| 沅江市| 鞍山市| 襄垣县| 千阳县| 邹城市|