*/
private List<Class> getFacesClasses(WebAppType webApp, WebModule webModule) throws DeploymentException {
log.debug("getFacesClasses( " + webApp.toString() + "," + '\n' +
(webModule != null ? webModule.getName() : null) + " ): Entry");
Deployable deployable = webModule.getDeployable();
Bundle bundle = webModule.getEarContext().getDeploymentBundle();
// 1. META-INF/faces-config.xml
List<Class> classes = new ArrayList<Class>();
URL url = deployable.getResource("META-INF/faces-config.xml");
if (url != null) {
parseConfigFile(url, bundle, classes);
}
// 2. WEB-INF/faces-config.xml
url = deployable.getResource("WEB-INF/faces-config.xml");
if (url != null) {
parseConfigFile(url, bundle, classes);
}
// 3. javax.faces.CONFIG_FILES
ParamValueType[] paramValues = webApp.getContextParamArray();
for (ParamValueType paramValue : paramValues) {
if (paramValue.getParamName().getStringValue().trim().equals("javax.faces.CONFIG_FILES")) {
String configFiles = paramValue.getParamValue().getStringValue().trim();
StringTokenizer st = new StringTokenizer(configFiles, ",", false);
while (st.hasMoreTokens()) {
String configfile = st.nextToken().trim();
if (!configfile.equals("")) {
if (configfile.startsWith("/")) {
configfile = configfile.substring(1);
}
url = deployable.getResource(configfile);
if (url == null) {
throw new DeploymentException("Could not locate config file " + configfile);
} else {
parseConfigFile(url, bundle, classes);
}