@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)); } } }