JSF being new to the developers, there are lot of questions arising as to where to place the JSF configuration files and also the order in which the files will be loaded by the system. Though the location is based on the JSF implementation, the standard approach that I have noticed is described below
- The implementation will search for /META-INF/faces-config.xml in all the JAR files loaded from WEB-INF/lib directory. If the implementation finds any one faces-config.xml, the file will be loaded to be used by the application. If not, it will move to the next step as mentioned in Step 2.
- If the files are not found in the above location, it will search for the javax.faces.application.CONFIG_FILES property in the web.xml file. The comma delimited names of the config files are given as the value for this property with the path from the root of the web application. This approach is to be used if different config files need to be loaded for the application which might happen when different modules are developed by different groups and they have all separate configurations file.
- Finally the implementation will search for faces-config.xml adjacent to the WEB.xml file directly under the WEB-INF folder, if it cannot find even a single faces config file in any of the locations mentioned in Step1 and Step 2.
No comments:
Post a Comment