protected List<ConfigurationResource> getContextFaceletsLibraries(WebApp webApp, WebModule webModule) throws DeploymentException { String moduleNamePrefix = webModule.isStandAlone() ? "" : webModule.getTargetPath() + "/"; for (ParamValue paramValue : webApp.getContextParam()) { if (paramValue.getParamName().trim().equals("javax.faces.FACELETS_LIBRARIES")) { List<ConfigurationResource> faceletsLibraries = new ArrayList<ConfigurationResource>(); String configFiles = paramValue.getParamValue().trim(); StringTokenizer st = new StringTokenizer(configFiles, ";", false); while (st.hasMoreTokens()) { String faceletsLibrary = st.nextToken().trim(); if (!faceletsLibrary.isEmpty()) { if (faceletsLibrary.startsWith("/")) { faceletsLibrary = faceletsLibrary.substring(1); } faceletsLibraries.add(new ConfigurationResource(null, moduleNamePrefix + faceletsLibrary)); } } return faceletsLibraries; } } return Collections.<ConfigurationResource> emptyList(); }
@Override public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException { for (ParamValue paramValue : webApp.getContextParam()) { context.setAttribute(QUALIFIED_CONTEXT_PARAM_NAME_PREFIX + paramValue.getParamName(), paramValue.getParamName()); } } }
protected List<FacesConfig> getContextFacesConfigs(WebApp webApp, WebModule webModule) throws DeploymentException { for (ParamValue paramValue : webApp.getContextParam()) { if (paramValue.getParamName().trim().equals(FacesServlet.CONFIG_FILES_ATTR)) { List<FacesConfig> contextFacesConfigs = new ArrayList<FacesConfig>(); String configFiles = paramValue.getParamValue().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); } //faces-config.xml is a center XML for JSF, we will read it separately. if (configfile.equals("WEB-INF/faces-config.xml")) { continue; } URL url = webModule.getEarContext().getTargetURL(webModule.resolve(configfile)); if (url == null) { throw new DeploymentException("Could not locate config file " + configfile + " configured with " + FacesServlet.CONFIG_FILES_ATTR + " in the web.xml"); } else { contextFacesConfigs.add(parseConfigFile(url, configfile)); } } } return contextFacesConfigs; } } return Collections.<FacesConfig> emptyList(); }
WebApp webApp = webModule.getWebApp(); if (webApp != null) { List<ParamValue> contextParam = webApp.getContextParam(); for (ParamValue value : contextParam) { boolean foundContextParam = value.getParamName().trim().equals("javax.faces.CONFIG_FILES");
WebApp webApp = webModule.getWebApp(); if (webApp != null) { List<ParamValue> contextParam = webApp.getContextParam(); for (ParamValue value : contextParam) { boolean foundContextParam = value.getParamName().trim().equals("javax.faces.CONFIG_FILES");
@Override public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException { String jarUrl = mergeContext.getCurrentJarUrl(); for (ParamValue paramValue : webFragment.getContextParam()) { String qualifiedContextParamName = QUALIFIED_CONTEXT_PARAM_NAME_PREFIX + paramValue.getParamName(); if (mergeContext.containsAttribute(qualifiedContextParamName)) { continue; } MergeItem existedContextParamValue = (MergeItem) mergeContext.getAttribute(qualifiedContextParamName); if (existedContextParamValue == null) { webApp.getContextParam().add(paramValue); mergeContext.setAttribute(qualifiedContextParamName, new MergeItem(paramValue.getParamValue(), jarUrl, ElementSource.WEB_FRAGMENT)); } else if (!existedContextParamValue.getValue().equals(paramValue.getParamValue())) { throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateKeyValueMessage("context-param", "param-name", paramValue.getParamName(), "param-value", existedContextParamValue.getValue().toString(), existedContextParamValue.getBelongedURL(), paramValue.getParamValue(), jarUrl)); } } }
WebAppInfo webAppInfo = webAppInfoFactory.newWebAppInfo(); addParams(webApp.getContextParam(), webAppInfo.contextParams);