[57703] Run on server should account for Jakarta package names
diff --git a/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF index 768c385..7e87c67 100644 --- a/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.jst.j2ee.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.eclipse.jst.j2ee.core; singleton:=true -Bundle-Version: 1.4.200.qualifier +Bundle-Version: 1.4.300.qualifier Bundle-Activator: org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin Bundle-Vendor: %Bundle-Vendor.0 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee.core/jee-models/org/eclipse/jst/javaee/web/internal/metadata/WebPackage.java b/plugins/org.eclipse.jst.j2ee.core/jee-models/org/eclipse/jst/javaee/web/internal/metadata/WebPackage.java index 4d47ae6..d2810d3 100644 --- a/plugins/org.eclipse.jst.j2ee.core/jee-models/org/eclipse/jst/javaee/web/internal/metadata/WebPackage.java +++ b/plugins/org.eclipse.jst.j2ee.core/jee-models/org/eclipse/jst/javaee/web/internal/metadata/WebPackage.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2022 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 @@ -322,6 +322,7 @@ String eNS_URI2 = J2EEConstants.WEB_APP_SCHEMA_LOC_3_0; String eNS_URI3 = J2EEConstants.WEB_APP_SCHEMA_LOC_3_1; String eNS_URI4 = J2EEConstants.WEB_APP_SCHEMA_LOC_4_0; + String eNS_URI5 = J2EEConstants.WEB_APP_SCHEMA_LOC_5_0; /** * The package namespace name.
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/Servlet.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/Servlet.java index b12f980..ebb5799 100644 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/Servlet.java +++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/Servlet.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. + * Copyright (c) 2001, 2022 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 @@ -32,7 +32,7 @@ * mapping, this must be done in the web-app. * @return java.util.List */ - public List getMappings(); + public List<ServletMapping> getMappings(); /** * Gets the Servlet parameters in java.util.Properties
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/WebApp.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/WebApp.java index 9e89c48..0c9b7f7 100644 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/WebApp.java +++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/WebApp.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. + * Copyright (c) 2001, 2022 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 @@ -230,7 +230,7 @@ * @generated This field/method will be replaced during code generation * @return The list of TagLibs references */ - EList getTagLibs(); + EList<TagLibRef> getTagLibs(); /** * @generated This field/method will be replaced during code generation @@ -278,7 +278,7 @@ * @generated This field/method will be replaced during code generation * @return The list of Servlets references */ - EList getServlets(); + EList<Servlet> getServlets(); /** * @generated This field/method will be replaced during code generation
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/ServletImpl.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/ServletImpl.java index 590348e..803d85e 100644 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/ServletImpl.java +++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/ServletImpl.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2022 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 @@ -10,11 +10,11 @@ *******************************************************************************/ package org.eclipse.jst.j2ee.webapplication.internal.impl; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Properties; -import java.util.Vector; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -131,13 +131,13 @@ * mapping, this must be done in the web-app. * @return java.util.List */ -public List getMappings() { +public List<ServletMapping> getMappings() { WebApp webApp = (WebApp) eContainer(); if (webApp == null) return new BasicEList(0); EList allMappings = webApp.getServletMappings(); Iterator i = allMappings.iterator(); - List mappings = new Vector(); + List<ServletMapping> mappings = new ArrayList<ServletMapping>(); while (i.hasNext()) { ServletMapping mapping = (ServletMapping) i.next(); if (mapping.getServlet() == this)
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/WebAppImpl.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/WebAppImpl.java index 91b99bb..5d067a8 100644 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/WebAppImpl.java +++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/webapplication/internal/impl/WebAppImpl.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2022 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 @@ -118,7 +118,7 @@ /** * @generated This field/method will be replaced during code generation. */ - protected EList tagLibs = null; + protected EList<TagLibRef> tagLibs = null; /** * @generated This field/method will be replaced during code generation. */ @@ -142,7 +142,7 @@ /** * @generated This field/method will be replaced during code generation. */ - protected EList servlets = null; + protected EList<Servlet> servlets = null; /** * @generated This field/method will be replaced during code generation. */ @@ -536,7 +536,7 @@ /** * @generated This field/method will be replaced during code generation */ - public EList getTagLibs() { + public EList<TagLibRef> getTagLibs() { if (tagLibs == null) { tagLibs = new EObjectContainmentWithInverseEList(TagLibRef.class, this, WebapplicationPackage.WEB_APP__TAG_LIBS, WebapplicationPackage.TAG_LIB_REF__WEB_APP); } @@ -686,7 +686,7 @@ /** * @generated This field/method will be replaced during code generation */ - public EList getServlets() { + public EList<Servlet> getServlets() { if (servlets == null) { servlets = new EObjectContainmentWithInverseEList(Servlet.class, this, WebapplicationPackage.WEB_APP__SERVLETS, WebapplicationPackage.SERVLET__WEB_APP); }
diff --git a/plugins/org.eclipse.jst.j2ee.core/pom.xml b/plugins/org.eclipse.jst.j2ee.core/pom.xml index 873558d..33d2c5c 100644 --- a/plugins/org.eclipse.jst.j2ee.core/pom.xml +++ b/plugins/org.eclipse.jst.j2ee.core/pom.xml
@@ -21,6 +21,6 @@ <groupId>org.eclipse.webtools.javaee</groupId> <artifactId>org.eclipse.jst.j2ee.core</artifactId> - <version>1.4.200-SNAPSHOT</version> + <version>1.4.300-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project>
diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java index 1e3c7be..38c4412 100644 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java +++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2022 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 @@ -57,6 +57,7 @@ public class WebDeployableArtifactUtil { private final static String GENERIC_SERVLET_CLASS_TYPE = "javax.servlet.GenericServlet"; //$NON-NLS-1$ + private final static String GENERIC_JAKARTA_SERVLET_CLASS_TYPE = "jakarta.servlet.GenericServlet"; //$NON-NLS-1$ private final static String CACTUS_SERVLET_CLASS_TYPE = "org.apache.cactus.server.ServletTestRedirector"; //$NON-NLS-1$ public WebDeployableArtifactUtil() { @@ -87,9 +88,9 @@ if (resources != null && resources[0] != null) component = resources[0].getComponent(); String mapping = null; - java.util.List mappings = ((Servlet) obj).getMappings(); + java.util.List<ServletMapping> mappings = ((Servlet) obj).getMappings(); if (mappings != null && !mappings.isEmpty()) { - ServletMapping map = (ServletMapping) mappings.get(0); + ServletMapping map = mappings.get(0); mapping = map.getUrlPattern(); } if (mapping != null) { @@ -245,6 +246,10 @@ } public static String getServletClassName(IResource resource) { + String className = getClassNameForType(resource, GENERIC_JAKARTA_SERVLET_CLASS_TYPE); + if (className != null) { + return className; + } return getClassNameForType(resource, GENERIC_SERVLET_CLASS_TYPE); } @@ -329,9 +334,9 @@ webApp = edit.getWebApp(); if (webApp == null) return null; - Iterator iterator = webApp.getServlets().iterator(); + Iterator<Servlet> iterator = webApp.getServlets().iterator(); while (iterator.hasNext()) { - Servlet servlet = (Servlet) iterator.next(); + Servlet servlet = iterator.next(); boolean valid = false; WebType webType = servlet.getWebType(); @@ -345,9 +350,9 @@ valid = true; } if (valid) { - java.util.List mappings = servlet.getMappings(); + java.util.List<ServletMapping> mappings = servlet.getMappings(); if (mappings != null && !mappings.isEmpty()) { - ServletMapping map = (ServletMapping) mappings.get(0); + ServletMapping map = mappings.get(0); return map.getUrlPattern(); } }
diff --git a/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF index e07d345..abdc260 100644 --- a/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.eclipse.jst.jee.ui;singleton:=true -Bundle-Version: 1.0.1000.qualifier +Bundle-Version: 1.0.1100.qualifier Bundle-Activator: org.eclipse.jst.jee.ui.plugin.JEEUIPlugin Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
diff --git a/plugins/org.eclipse.jst.jee.ui/pom.xml b/plugins/org.eclipse.jst.jee.ui/pom.xml index aadac60..aff68f8 100644 --- a/plugins/org.eclipse.jst.jee.ui/pom.xml +++ b/plugins/org.eclipse.jst.jee.ui/pom.xml
@@ -21,6 +21,6 @@ <groupId>org.eclipse.webtools.javaee</groupId> <artifactId>org.eclipse.jst.jee.ui</artifactId> - <version>1.0.1000-SNAPSHOT</version> + <version>1.0.1100-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project>
diff --git a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/deployables/WebDeployableArtifactUtil.java b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/deployables/WebDeployableArtifactUtil.java index 95a7f17..8132888 100644 --- a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/deployables/WebDeployableArtifactUtil.java +++ b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/deployables/WebDeployableArtifactUtil.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2021 IBM Corporation and others. + * Copyright (c) 2003, 2022 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 @@ -67,6 +67,7 @@ public class WebDeployableArtifactUtil { private final static String GENERIC_SERVLET_CLASS_TYPE = "javax.servlet.GenericServlet"; //$NON-NLS-1$ + private final static String GENERIC_JAKARTA_SERVLET_CLASS_TYPE = "jakarta.servlet.GenericServlet"; //$NON-NLS-1$ private final static String CACTUS_SERVLET_CLASS_TYPE = "org.apache.cactus.server.ServletTestRedirector"; //$NON-NLS-1$ public WebDeployableArtifactUtil() { @@ -272,6 +273,10 @@ } public static String getServletClassName(IResource resource) { + String className = getClassNameForType(resource, GENERIC_JAKARTA_SERVLET_CLASS_TYPE); + if (className != null) { + return className; + } return getClassNameForType(resource, GENERIC_SERVLET_CLASS_TYPE); } @@ -365,7 +370,7 @@ ServletMapping map = it.next(); if (map.getServletName().equals(servlet.getServletName())) { UrlPatternType urlPattern = map.getUrlPatterns().get(0); - return urlPattern.getValue(); + return urlPattern.getValue(); } } }
diff --git a/plugins/org.eclipse.jst.servlet.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.servlet.ui/META-INF/MANIFEST.MF index 10780cb..7dfd592 100644 --- a/plugins/org.eclipse.jst.servlet.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.jst.servlet.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jst.servlet.ui; singleton:=true -Bundle-Version: 1.1.1200.qualifier +Bundle-Version: 1.1.1300.qualifier Bundle-Activator: org.eclipse.jst.servlet.ui.internal.plugin.ServletUIPlugin Bundle-Vendor: %pluginVendor Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.servlet.ui/plugin.xml b/plugins/org.eclipse.jst.servlet.ui/plugin.xml index 2625ec7..1e5a71f 100644 --- a/plugins/org.eclipse.jst.servlet.ui/plugin.xml +++ b/plugins/org.eclipse.jst.servlet.ui/plugin.xml
@@ -243,7 +243,7 @@ <adapt type="org.eclipse.core.resources.IProject"> <test forcePluginActivation="true" property="org.eclipse.wst.common.project.facet.core.projectFacet" - value="jst.web:2.4]" /> + value="jst.web:5.0]" /> </adapt> </with> </enablement> @@ -257,7 +257,7 @@ <adapt type="org.eclipse.core.resources.IFile"> <test forcePluginActivation="true" property="org.eclipse.wst.common.project.facet.core.projectFacet" - value="jst.web:2.4]" /> + value="jst.web:5.0]" /> </adapt> </with> </enablement> @@ -272,7 +272,7 @@ <adapt type="org.eclipse.jdt.core.ICompilationUnit"> <test forcePluginActivation="true" property="org.eclipse.jst.j2ee.common.projectFacet" - value="jst.web:2.4]" /> + value="jst.web:5.0]" /> </adapt> </with> </enablement>
diff --git a/plugins/org.eclipse.jst.servlet.ui/pom.xml b/plugins/org.eclipse.jst.servlet.ui/pom.xml index 2663eaa..0c11f6b 100644 --- a/plugins/org.eclipse.jst.servlet.ui/pom.xml +++ b/plugins/org.eclipse.jst.servlet.ui/pom.xml
@@ -21,6 +21,6 @@ <groupId>org.eclipse.webtools.javaee</groupId> <artifactId>org.eclipse.jst.servlet.ui</artifactId> - <version>1.1.1200-SNAPSHOT</version> + <version>1.1.1300-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project>