Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2011-01-13 05:24:17 +0000
committernitind2011-01-13 05:24:17 +0000
commit39926bec34698c4be4a86f25d42828fb34f36226 (patch)
treee5f59c0eb5b8eb5e54717d205a6f35b15ad79e7e
parentad800bf6fdb8f052b26a03a745bcba9f6fc0b095 (diff)
downloadwebtools.sourceediting-39926bec34698c4be4a86f25d42828fb34f36226.tar.gz
webtools.sourceediting-39926bec34698c4be4a86f25d42828fb34f36226.tar.xz
webtools.sourceediting-39926bec34698c4be4a86f25d42828fb34f36226.zip
[325554] JSP editor treated inclusion of an non-existing Servlet as valid, when a catch-all filter (*) is defined in web.xml
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
index d64107afaa..87b73c7cbe 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -565,6 +565,7 @@ public final class DeploymentDescriptorPropertyCache {
static final String SCRIPTING_INVALID = "scripting-invalid"; //$NON-NLS-1$
static final String URL_PATTERN = "url-pattern"; //$NON-NLS-1$
+ private static final String SERVLET_MAPPING = "servlet-mapping"; //$NON-NLS-1$
private static final String WEB_APP_ELEMENT_LOCAL_NAME = ":web-app"; //$NON-NLS-1$
private static final String WEB_APP_ELEMENT_NAME = "web-app"; //$NON-NLS-1$
@@ -682,11 +683,16 @@ public final class DeploymentDescriptorPropertyCache {
}
}
+ // 325554 : only apply to URL patterns for Servlet mappings
NodeList urlPatternElements = document.getElementsByTagName(URL_PATTERN);
- for (int i = 0; i < urlPatternElements.getLength(); i++) {
- String urlPattern = getContainedText(urlPatternElements.item(i));
- if(urlPattern != null && urlPattern.length() > 0) {
- urlPatterns.add(new StringMatcher(urlPattern));
+ int urlPatternElementCount = urlPatternElements.getLength();
+ for (int i = 0; i < urlPatternElementCount; i++) {
+ Node urlPatternElement = urlPatternElements.item(i);
+ if (SERVLET_MAPPING.equals(urlPatternElement.getParentNode().getNodeName())) {
+ String urlPattern = getContainedText(urlPatternElement);
+ if (urlPattern != null && urlPattern.length() > 0) {
+ urlPatterns.add(new StringMatcher(urlPattern));
+ }
}
}
}

Back to the top