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:
All JAR file resources in the web application’s
ServletContextresource paths (in the reverse order of which they are returned by theServletContextgetResourcePaths( )method) are scanned for files named META-INF/faces-config.xml.A comma-separated list of context-relative paths defined by the
javax.faces.CONFIG_FILEScontext parameter in the web.xml file.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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access