The JSF application configuration is handled through an XML file, which defaults to Faces-config.xml, where the application-supported sites, beans, navigation, and so on are configured. In actual development, if the project is large, many modules of the bean will be configured to the Faces-config.xml file, causing the file too large content miscellaneous, preferably as a spring configuration file into multiple, a module corresponding to a configuration file, so it is easy to manage.
JSF is a support for multiple configuration files. By default, it looks for file Web-inf/faces-config.xml and can specify additional profiles by Javax.faces.CONFIG_FILESS context parameters (Note: additional configuration Files ).
Additional configuration file: Refers to files other than faces-config.xml files. Because the Faces-config.xml file is the default file for the system, it is loaded automatically, and is repeated if specified again in the context parameter. So the default Faces-config.xml file must not be added.
Specific examples are as follows: (note: Due to personal network restrictions picture upload, temporarily do not upload picture description)
If the system has user management and system Management two modules, the implementation of multiple configuration files.
1, the file structure is as follows
----WebContent
--------Web-inf
------------Faces-config.xml
------------User-faces-config.xml
------------Sys-faces-config.xml
User-faces-config.xml file only configures the Manage bean associated with the user management module
Sys-faces-config.xml file only configures the Manage bean associated with the System Management module
JSF differs from spring multiple profiles and does not require additional JSF file path configurations specified in the Faces-config.xml file
If the system has user management and system Management two modules, the implementation of multiple configuration files.
2,web.xml file
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value >
/web-inf/user-faces-config.xml,
/web-inf/sys-faces-config.xml
</param-value>