O'Reilly logo

JavaServer Faces by Hans Bergsten

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Packaging Custom Classes

JSF merges the definitions found in multiple faces-config.xml files. When a JSF application starts, the implementation looks for faces-config.xml files in this order:

  1. All JAR file resources in the web application’s ServletContext resource paths (in the reverse order of which they are returned by the ServletContext getResourcePaths( ) method) are scanned for files named META-INF/faces-config.xml.

  2. A comma-separated list of context-relative paths defined by the javax.faces.CONFIG_FILES context parameter in the web.xml file.

  3. The WEB-INF/faces-config.xml file.

This algorithm allows developers of custom classes to bundle them in JAR files with their declarations, making installation as easy as dropping the JAR file into the WEB-INF/lib directory. Because the WEB-INF/faces-config.xml file is considered last, you can override all configuration setting for a specific application in this file. Factory classes can be declared in additional files. See Appendix D for details.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required