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

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.

主站蜘蛛池模板: 汾阳市| 滦平县| 额尔古纳市| 山丹县| 雅安市| 津市市| 古田县| 即墨市| 连江县| 崇义县| 大荔县| 呼伦贝尔市| 闻喜县| 台北县| 万安县| 临高县| 汤阴县| 左贡县| 襄城县| 弥勒县| 竹北市| 曲麻莱县| 齐河县| 民县| 莱州市| 林州市| 黎城县| 莱西市| 万全县| 娱乐| 克东县| 海宁市| 通化市| 苗栗县| 绍兴市| 永修县| 邛崃市| 张家港市| 修水县| 靖州| 嘉义市|