* @param paramName
* @param paramValue
*/
public static void setupContextParam(final WebApp webApp, String paramName, String paramValue) {
// if not default name and location, then add context param
ParamValue foundCP = null;
ParamValue cp = null;
boolean found = false;
// check to see if present
Iterator it = webApp.getContextParams().iterator();
while (it.hasNext()) {
cp = (org.eclipse.jst.javaee.core.ParamValue) it.next();
if (cp != null &&
cp.getParamName()!= null &&
cp.getParamName().trim().equals(paramName)) {
foundCP = cp;
found = true;
}
}
if (!found) {
ParamValue pv = JavaeeFactory.eINSTANCE.createParamValue();
pv.setParamName(paramName);
pv.setParamValue(paramValue);
webApp.getContextParams().add(pv);
} else {
cp = foundCP;
if (cp.getParamValue().indexOf(paramValue) < 0) {
String curVal = cp.getParamValue();