Jetty 12 : XML namespace cleanup (#8406)

* Adding Servlet 6 XML Entities
* Fixing bad xsi:schemaLocation entries
* Update all jetty-ee10 web XMLs to JakartaEE version 6.0 based
* Using XML Catalog
* Introducing catalogs for:
   - default XML xsd/dtd (catalog-org.w3.xml)
   - Configure dtd (catalog-configure.xml)
   - EE10 Servlet 6 xsd/dtd (catalog-ee10.xml)
   - EE9 Servlet 5 xsd/dtd (catalog-ee9.xml)
   - EE8 Servlet 4 xsd/dtd (catalog-ee8.xml)
* New XmlParser.addCatalog(URI catalogXml, Class<?> classBase)
   to allow the loading of a catalog which has it's resources
   referenced via the classBase.getResource(name)
* WebDescriptor uses Environment to load appropriate catalog.
* Remove XmlParser.redirectEntity(String, String)
This commit is contained in:
Joakim Erdfelt 2022-08-09 06:34:29 -05:00 committed by GitHub
parent e7e570f4bb
commit 199a9cd2ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
70 changed files with 943 additions and 628 deletions

View File

@ -35,31 +35,6 @@ import java.util.ResourceBundle;
*/
public class Loader
{
/**
* Similar to {@link #getResource(String)}, but throws an {@link IllegalStateException} if the requested resource
* is not found in the classlaoders.
*
* @param name the resource to look up
* @return the URL to the resource
* @throws IllegalStateException if unable to find the resource
*/
public static URL getRequiredResource(String name)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = null;
if (loader != null)
url = loader.getResource(name);
if (url == null)
url = ClassLoader.getSystemResource(name);
if (url == null)
throw new IllegalStateException("Missing required resource: " + name);
return url;
}
public static URL getResource(String name)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();

View File

@ -0,0 +1,216 @@
//
// ========================================================================
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.xml;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Stream;
import javax.xml.catalog.Catalog;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.jetty.util.TypeUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
* <p>
* A catalog implementation where the {@code xml:base} is defined externally
* of the catalog XML, allowing for runtime determination of the {@code xml:base}
* (such as pointing to the contents of a remote location)
* </p>
* <p>
* This is a temporary Catalog implementation, and should be removed once
* all of our usages of {@code servlet-api-<ver>.jar} have their own
* {@code catalog.xml} files.
* </p>
*/
public class BaseClassCatalog implements Catalog, EntityResolver
{
public static BaseClassCatalog load(URI uriToCatalogXml, Class<?> baseClass) throws IOException
{
return new CatalogReader(uriToCatalogXml, baseClass).parse();
}
private static class CatalogReader
{
private final URI catalogUri;
private final Class<?> baseClass;
public CatalogReader(URI uriToCatalogXml, Class<?> baseClass)
{
this.catalogUri = Objects.requireNonNull(uriToCatalogXml, "Catalog XML");
this.baseClass = Objects.requireNonNull(baseClass, "Base Class");
}
public BaseClassCatalog parse() throws IOException
{
try (InputStream in = catalogUri.toURL().openStream())
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(false);
DocumentBuilder db = dbf.newDocumentBuilder();
dbf.setFeature("http://apache.org/xml/features/validation/schema", false);
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
InputSource input = new InputSource(in);
Document doc = db.parse(input);
Element root = doc.getDocumentElement();
Map<String, String> publicIdMap = getMapping(root, "public", "publicId");
Map<String, String> systemIdMap = getMapping(root, "system", "systemId");
return new BaseClassCatalog(publicIdMap, systemIdMap);
}
catch (ParserConfigurationException | SAXException e)
{
throw new IOException("Unable to parse: " + catalogUri, e);
}
}
private Map<String, String> getMapping(Element root, String elementName, String attrIdName) throws IOException
{
Map<String, String> mapping = new HashMap<>();
NodeList nodeList = root.getElementsByTagNameNS("*", elementName);
for (int i = 0; i < nodeList.getLength(); i++)
{
Element elem = (Element)nodeList.item(i);
String id = elem.getAttribute(attrIdName);
String ref = elem.getAttribute("uri");
try
{
if (new URI(ref).isAbsolute())
mapping.put(id, ref);
else
{
URL url = baseClass.getResource(ref);
if (url == null)
throw new FileNotFoundException("Unable to find ref [%s/%s] in same archive as %s: %s"
.formatted(baseClass.getPackageName().replace('.', '/'),
ref, baseClass.getName(),
TypeUtil.getLocationOfClass(baseClass)));
mapping.put(id, url.toExternalForm());
}
}
catch (URISyntaxException e)
{
throw new IOException("Unable to parse %s - bad URI in: %s".formatted(catalogUri, elem), e);
}
}
return mapping;
}
}
private final Map<String, String> publicIdMap;
private final Map<String, String> systemIdMap;
private BaseClassCatalog(Map<String, String> publicIdMap, Map<String, String> systemIdMap)
{
this.publicIdMap = Objects.requireNonNull(publicIdMap, "Public ID Map");
this.systemIdMap = Objects.requireNonNull(systemIdMap, "System ID Map");
}
@Override
public Stream<Catalog> catalogs()
{
// empty, we have no alternative catalogs
return Stream.of();
}
@Override
public String matchPublic(String publicId)
{
return publicIdMap.get(publicId);
}
@Override
public String matchSystem(String systemId)
{
return systemIdMap.get(systemId);
}
@Override
public String matchURI(String uri)
{
for (Map.Entry<String, String> entry : publicIdMap.entrySet())
{
if (entry.getValue().equals(uri))
return entry.getKey();
}
for (Map.Entry<String, String> entry : systemIdMap.entrySet())
{
if (entry.getValue().equals(uri))
return entry.getKey();
}
return null;
}
/**
* Implementation of {@link org.xml.sax.EntityResolver}
*
* @see org.xml.sax.EntityResolver#resolveEntity(String, String)
*/
@Override
public InputSource resolveEntity(String publicId, String systemId)
{
String resolvedSystemId = null;
if (systemId != null)
{
// DTD's need to be searched in a simple filename only form to maintain
// backward compat with older DTD spec in regard to SYSTEM identifiers.
if (systemId.toLowerCase(Locale.ENGLISH).endsWith(".dtd"))
{
int idx = systemId.lastIndexOf('/');
if (idx >= 0)
{
resolvedSystemId = matchSystem(systemId.substring(idx + 1));
}
}
// Search full systemId
if (resolvedSystemId == null)
resolvedSystemId = matchSystem(systemId);
}
if (resolvedSystemId == null && publicId != null)
{
resolvedSystemId = matchPublic(publicId);
}
if (resolvedSystemId == null && systemId != null)
{
resolvedSystemId = matchURI(systemId);
}
if (resolvedSystemId != null)
{
return new InputSource(resolvedSystemId);
}
return null;
}
}

View File

@ -26,6 +26,7 @@ import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.UnknownHostException;
import java.nio.file.Files;
@ -1996,36 +1997,10 @@ public class XmlConfiguration
{
_entry = entry;
Class<?> klass = XmlConfiguration.class;
URL config60 = klass.getResource("configure_6_0.dtd");
URL config76 = klass.getResource("configure_7_6.dtd");
URL config90 = klass.getResource("configure_9_0.dtd");
URL config93 = klass.getResource("configure_9_3.dtd");
URL config100 = klass.getResource("configure_10_0.dtd");
redirectEntity("configure.dtd", config93);
redirectEntity("configure_1_0.dtd", config60);
redirectEntity("configure_1_1.dtd", config60);
redirectEntity("configure_1_2.dtd", config60);
redirectEntity("configure_1_3.dtd", config60);
redirectEntity("configure_6_0.dtd", config60);
redirectEntity("configure_7_6.dtd", config76);
redirectEntity("configure_9_0.dtd", config90);
redirectEntity("configure_9_3.dtd", config93);
redirectEntity("configure_10_0.dtd", config100);
redirectEntity("http://jetty.mortbay.org/configure.dtd", config93);
redirectEntity("http://jetty.mortbay.org/configure_9_3.dtd", config93);
redirectEntity("http://jetty.eclipse.org/configure.dtd", config93);
redirectEntity("https://jetty.eclipse.org/configure.dtd", config93);
redirectEntity("http://www.eclipse.org/jetty/configure.dtd", config93);
redirectEntity("https://www.eclipse.org/jetty/configure.dtd", config93);
redirectEntity("http://www.eclipse.org/jetty/configure_9_3.dtd", config93);
redirectEntity("https://www.eclipse.org/jetty/configure_9_3.dtd", config93);
redirectEntity("https://www.eclipse.org/jetty/configure_10_0.dtd", config100);
redirectEntity("-//Mort Bay Consulting//DTD Configure//EN", config100);
redirectEntity("-//Jetty//Configure//EN", config100);
URL catalogUrl = XmlConfiguration.class.getResource("catalog-configure.xml");
if (catalogUrl == null)
throw new IllegalStateException("Catalog not found: catalog-configure.xml");
addCatalog(URI.create(catalogUrl.toExternalForm()));
}
@Override

View File

@ -16,15 +16,21 @@ package org.eclipse.jetty.xml;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Stack;
import java.util.StringTokenizer;
import javax.xml.catalog.Catalog;
import javax.xml.catalog.CatalogFeatures;
import javax.xml.catalog.CatalogManager;
import javax.xml.catalog.CatalogResolver;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
@ -34,6 +40,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
@ -52,63 +59,44 @@ public class XmlParser
private static final Logger LOG = LoggerFactory.getLogger(XmlParser.class);
private final AutoLock _lock = new AutoLock();
private Map<String, URL> _redirectMap = new HashMap<String, URL>();
private SAXParser _parser;
private Map<String, ContentHandler> _observerMap;
private Stack<ContentHandler> _observers = new Stack<ContentHandler>();
private String _xpath;
private Object _xpaths;
private String _dtd;
private List<EntityResolver> _entityResolvers = new ArrayList<>();
/**
* Construct
* Construct XmlParser
*/
public XmlParser()
{
this(getValidatingDefault());
}
/**
* Construct XmlParser
*
* @param validating true to enable validation, false to disable
* @see SAXParserFactory#setValidating(boolean)
*/
public XmlParser(boolean validating)
{
setValidating(validating);
URL url = XmlParser.class.getResource("catalog-org.w3.xml");
if (url == null)
throw new IllegalStateException("Catalog not found: catalog-org.w3.xml");
addCatalog(URI.create(url.toExternalForm()));
}
private static boolean getValidatingDefault()
{
SAXParserFactory factory = SAXParserFactory.newInstance();
boolean validatingDefault = factory.getClass().toString().contains("org.apache.xerces.");
String validatingProp = System.getProperty("org.eclipse.jetty.xml.XmlParser.Validating", validatingDefault ? "true" : "false");
boolean validating = Boolean.valueOf(validatingProp).booleanValue();
setValidating(validating);
initDefaultEntities();
}
public XmlParser(boolean validating)
{
setValidating(validating);
initDefaultEntities();
}
/**
* Initialize common XML Entities needed for generic XML parsing needs.
*/
private void initDefaultEntities()
{
final URL schemadtd = getRequiredResource("XMLSchema.dtd");
redirectEntity("XMLSchema.dtd", schemadtd);
redirectEntity("-//W3C//DTD XMLSCHEMA 200102//EN", schemadtd);
redirectEntity("http://www.w3.org/2001/XMLSchema.dtd", schemadtd);
redirectEntity("https://www.w3.org/2001/XMLSchema.dtd", schemadtd);
final URL xmlxsd = getRequiredResource("xml.xsd");
redirectEntity("xml.xsd", xmlxsd);
redirectEntity("http://www.w3.org/2001/xml.xsd", xmlxsd);
redirectEntity("https://www.w3.org/2001/xml.xsd", xmlxsd);
final URL datatypesdtd = getRequiredResource("datatypes.dtd");
redirectEntity("datatypes.dtd", datatypesdtd);
redirectEntity("http://www.w3.org/2001/datatypes.dtd", datatypesdtd);
redirectEntity("https://www.w3.org/2001/datatypes.dtd", datatypesdtd);
}
private URL getRequiredResource(String name)
{
// using Class.getResource(String) here to satisfy JPMS rules
URL url = XmlParser.class.getResource(name);
if (url == null)
throw new IllegalStateException("Missing required resource: " + name);
return url;
return Boolean.parseBoolean(validatingProp);
}
AutoLock lock()
@ -162,15 +150,36 @@ public class XmlParser
return _parser.isValidating();
}
public void redirectEntity(String name, URL entity)
/**
* Load the specified URI as a catalog for entity mapping purposes.
*
* <p>
* This is a temporary Catalog implementation, and should be removed once
* all of our usages of {@code servlet-api-<ver>.jar} have their own
* {@code catalog.xml} files.
* </p>
*
* @param catalogXml the URI pointing to the XML catalog
* @param baseClassLocation the base class to use for finding relative resources defined in the Catalog XML.
* This is resolved to the Class location with package location and is used as the XML Catalog Base URI.
*/
public void addCatalog(URI catalogXml, Class<?> baseClassLocation) throws IOException
{
if (entity != null)
{
try (AutoLock l = _lock.lock())
{
_redirectMap.put(name, entity);
}
}
BaseClassCatalog catalog = BaseClassCatalog.load(catalogXml, baseClassLocation);
_entityResolvers.add(catalog);
}
/**
* Load the specified URI as a catalog for entity mapping purposes.
*
* @param catalogXml the uri to the catalog
*/
public void addCatalog(URI catalogXml)
{
CatalogFeatures f = CatalogFeatures.builder().with(CatalogFeatures.Feature.RESOLVE, "continue").build();
Catalog catalog = CatalogManager.catalog(f, catalogXml);
CatalogResolver catalogResolver = CatalogManager.catalogResolver(catalog);
_entityResolvers.add(catalogResolver);
}
/**
@ -284,44 +293,22 @@ public class XmlParser
return parse(new InputSource(in));
}
protected InputSource resolveEntity(String pid, String sid)
private InputSource resolveEntity(String pid, String sid)
{
if (LOG.isDebugEnabled())
LOG.debug("resolveEntity({},{})", pid, sid);
if (sid != null && sid.endsWith(".dtd"))
_dtd = sid;
URL entity = null;
if (pid != null)
entity = (URL)_redirectMap.get(pid);
if (entity == null)
entity = (URL)_redirectMap.get(sid);
if (entity == null)
{
String dtd = sid;
if (dtd.lastIndexOf('/') >= 0)
dtd = dtd.substring(dtd.lastIndexOf('/') + 1);
if (LOG.isDebugEnabled())
LOG.debug("Can't exact match entity in redirect map, trying {}", dtd);
entity = (URL)_redirectMap.get(dtd);
}
if (entity != null)
for (EntityResolver entityResolver : _entityResolvers)
{
try
{
InputStream in = entity.openStream();
if (LOG.isDebugEnabled())
LOG.debug("Redirected entity {} --> {}", sid, entity);
InputSource is = new InputSource(in);
is.setSystemId(sid);
return is;
InputSource src = entityResolver.resolveEntity(pid, sid);
if (src != null)
return src;
}
catch (IOException e)
catch (IOException | SAXException e)
{
LOG.trace("IGNORED", e);
LOG.trace("IGNORE EntityResolver exception for (pid=%s, sid=%s)".formatted(pid, sid), e);
}
}
return null;

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!-- version-less systemId references -->
<system systemId="http://jetty.mortbay.org/configure.dtd" uri="configure_9_3.dtd"/>
<system systemId="https://jetty.mortbay.org/configure.dtd" uri="configure_9_3.dtd"/>
<system systemId="http://jetty.eclipse.org/configure.dtd" uri="configure_9_3.dtd"/>
<system systemId="https://jetty.eclipse.org/configure.dtd" uri="configure_9_3.dtd"/>
<public publicId="configure.dtd" uri="configure_9_3.dtd"/>
<!-- old versions -->
<public publicId="configure_1_0.dtd" uri="configure_1_0.dtd"/>
<public publicId="configure_1_1.dtd" uri="configure_1_1.dtd"/>
<public publicId="configure_1_2.dtd" uri="configure_1_2.dtd"/>
<public publicId="configure_1_3.dtd" uri="configure_1_3.dtd"/>
<public publicId="configure_6_0.dtd" uri="configure_6_0.dtd"/>
<public publicId="configure_7_6.dtd" uri="configure_7_6.dtd"/>
<!-- 9.0 -->
<public publicId="configure_9_0.dtd" uri="configure_9_0.dtd"/>
<system systemId="http://jetty.mortbay.org/configure_9_0.dtd" uri="configure_9_0.dtd"/>
<system systemId="https://jetty.mortbay.org/configure_9_0.dtd" uri="configure_9_0.dtd"/>
<system systemId="http://jetty.eclipse.org/configure_9_0.dtd" uri="configure_9_0.dtd"/>
<system systemId="https://jetty.eclipse.org/configure_9_0.dtd" uri="configure_9_0.dtd"/>
<system systemId="http://www.eclipse.org/jetty/configure_9_0.dtd" uri="configure_9_0.dtd"/>
<system systemId="https://www.eclipse.org/jetty/configure_9_0.dtd" uri="configure_9_0.dtd"/>
<!-- 9.3 -->
<public publicId="configure_9_3.dtd" uri="configure_9_3.dtd"/>
<system systemId="http://jetty.mortbay.org/configure_9_3.dtd" uri="configure_9_3.dtd"/>
<system systemId="https://jetty.mortbay.org/configure_9_3.dtd" uri="configure_9_3.dtd"/>
<system systemId="http://jetty.eclipse.org/configure_9_3.dtd" uri="configure_9_3.dtd"/>
<system systemId="https://jetty.eclipse.org/configure_9_3.dtd" uri="configure_9_3.dtd"/>
<system systemId="http://www.eclipse.org/jetty/configure_9_3.dtd" uri="configure_9_3.dtd"/>
<system systemId="https://www.eclipse.org/jetty/configure_9_3.dtd" uri="configure_9_3.dtd"/>
<!-- 10.0 -->
<public publicId="configure_10_0.dtd" uri="configure_10_0.dtd"/>
<system systemId="http://jetty.eclipse.org/configure_10_0.dtd" uri="configure_10_0.dtd"/>
<system systemId="https://jetty.eclipse.org/configure_10_0.dtd" uri="configure_10_0.dtd"/>
<system systemId="http://www.eclipse.org/jetty/configure_10_0.dtd" uri="configure_10_0.dtd"/>
<system systemId="https://www.eclipse.org/jetty/configure_10_0.dtd" uri="configure_10_0.dtd"/>
<public publicId="-//Jetty//Configure//EN" uri="configure_10_0.dtd"/>
</catalog>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!-- short name publicId reference to long form URI
the long form URI is generated by the Java XML Catalog implementation
to be the same absolute URI location as this Catalog but with a different
filename.
-->
<public publicId="datatypes.dtd" uri="datatypes.dtd" />
<public publicId="XMLSchema.dtd" uri="XMLSchema.dtd"/>
<public publicId="xml.xsd" uri="xml.xsd" />
<!-- publicId names used within other existing dtd's -->
<public publicId="datatypes" uri="datatypes.dtd" />
<!-- systemIds for these resources -->
<system systemId="http://www.w3.org/2001/XMLSchema.dtd" uri="XMLSchema.dtd" />
<system systemId="https://www.w3.org/2001/XMLSchema.dtd" uri="XMLSchema.dtd" />
</catalog>

View File

@ -0,0 +1,50 @@
//
// ========================================================================
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.xml;
import java.net.URISyntaxException;
import java.net.URL;
import javax.xml.catalog.Catalog;
import javax.xml.catalog.CatalogFeatures;
import javax.xml.catalog.CatalogManager;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class CatalogTest
{
@Test
public void loadCatalogOrgW3() throws URISyntaxException
{
URL url = XmlParser.class.getResource("catalog-org.w3.xml");
assertNotNull(url, "Catalog not found: catalog-org.w3.xml");
Catalog catalog = CatalogManager.catalog(CatalogFeatures.builder().build(), url.toURI());
assertNotNull(catalog, "Catalog should have been loaded");
// Show that even a short hand usage in catalog results in full URL to resource
String result = catalog.matchPublic("datatypes");
assertThat(result, startsWith("file:/"));
assertThat(result, endsWith("org/eclipse/jetty/xml/datatypes.dtd"));
// Show that even a URI references results in full URL to resource
result = catalog.matchSystem("https://www.w3.org/2001/XMLSchema.dtd");
assertThat(result, startsWith("file:/"));
assertThat(result, endsWith("org/eclipse/jetty/xml/XMLSchema.dtd"));
}
}

View File

@ -14,9 +14,12 @@
package org.eclipse.jetty.xml;
import java.net.URL;
import java.nio.file.Path;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class XmlParserTest
@ -24,18 +27,48 @@ public class XmlParserTest
@Test
public void testXmlParser() throws Exception
{
XmlParser parser = new XmlParser();
URL configURL = XmlConfiguration.class.getResource("configure_10_0.dtd");
parser.redirectEntity("configure_10_0.dtd", configURL);
parser.redirectEntity("http://jetty.eclipse.org/configure.dtd", configURL);
parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN", configURL);
URL url = XmlParserTest.class.getClassLoader().getResource("org/eclipse/jetty/xml/configureWithAttr.xml");
XmlParser parser = new XmlParser(true);
URL url = XmlParserTest.class.getResource("configureWithAttr.xml");
assertNotNull(url);
XmlParser.Node testDoc = parser.parse(url.toString());
String testDocStr = testDoc.toString().trim();
assertTrue(testDocStr.startsWith("<Configure"));
assertTrue(testDocStr.endsWith("</Configure>"));
}
@Test
public void testAddCatalogSimple() throws Exception
{
XmlParser parser = new XmlParser(true);
URL catalogUrl = XmlParser.class.getResource("catalog-configure.xml");
assertNotNull(catalogUrl);
parser.addCatalog(catalogUrl.toURI());
URL xmlUrl = XmlParserTest.class.getResource("configureWithAttr.xml");
assertNotNull(xmlUrl);
XmlParser.Node testDoc = parser.parse(xmlUrl.toString());
String testDocStr = testDoc.toString().trim();
assertTrue(testDocStr.startsWith("<Configure"));
assertTrue(testDocStr.endsWith("</Configure>"));
}
@Test
public void testAddCatalogOverrideBaseUri() throws Exception
{
XmlParser parser = new XmlParser(true);
ClassLoader classLoader = XmlParser.class.getClassLoader();
URL catalogUrl = classLoader.getResource("org/eclipse/jetty/xml/deep/catalog-test.xml");
assertNotNull(catalogUrl);
parser.addCatalog(catalogUrl.toURI(), XmlParserTest.class);
Path testXml = MavenTestingUtils.getTestResourcePathFile("xmls/test.xml");
XmlParser.Node testDoc = parser.parse(testXml.toUri().toString());
String testDocStr = testDoc.toString().trim();
assertTrue(testDocStr.startsWith("<test"));
assertTrue(testDocStr.endsWith("</test>"));
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="test.dtd" uri="test.dtd" />
</catalog>

View File

@ -0,0 +1,2 @@
<!ELEMENT test (description?) >
<!ELEMENT description (#PCDATA) >

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE test SYSTEM "test.dtd">
<test>
<description>An Example XML</description>
</test>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" version="4.0">
<web-fragment
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_0.xsd"
version="6.0">
<name>ardvaark</name>
</web-fragment>

View File

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" metadata-complete="true" version="4.0">
<web-fragment
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_0.xsd"
metadata-complete="true"
version="6.0">
<name>badger</name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<display-name>Test 31 WebApp</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="true"
version="3.1">
version="6.0">
<display-name>Test 31 WebApp</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_0.xsd"
version="6.0">
<servlet>
<display-name>SerialRestServlet</display-name>
<servlet-name>SerialRestServlet</servlet-name>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>EE10 Demo Async REST WebApp</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<!-- This web.xml format file is an override file that is applied to the test webapp AFTER

View File

@ -2,9 +2,9 @@
<web-app
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="5.0">
version="6.0">
<display-name>EE10 Demo Jetty WebApp</display-name>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>EE10 Demo JSP WebApp</display-name>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>EE10 Demo Simple WebApp</display-name>

View File

@ -64,10 +64,9 @@
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Bundle-Description>Test Webapp for Servlet 5.0 Features</Bundle-Description>
<!-- TODO Add 'org.eclipse.jetty.util;version="[9.4.19,9.4.20)",' below, once 9.4.19 is released with a fix for #3726 -->
<Bundle-Description>Test Webapp for Servlet 6.0 Features</Bundle-Description>
<Import-Package>
jakarta.transaction*;version="2.0.0", jakarta.servlet*;version="[5,6)", org.eclipse.jetty*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))", org.eclipse.jetty.webapp;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", org.eclipse.jetty.plus.jndi;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", org.example;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}", *
jakarta.transaction*;version="2.0.0", jakarta.servlet*;version="[6,7)", org.eclipse.jetty*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))", org.eclipse.jetty.webapp;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", org.eclipse.jetty.plus.jndi;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", org.example;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}", *
</Import-Package>
<_nouses />
<Export-Package>org.example.test;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}";-noimport:=true</Export-Package>

View File

@ -2,9 +2,9 @@
<web-app
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="5.0">
version="6.0">
<display-name>EE10 Demo Spec WebApp</display-name>

View File

@ -19,7 +19,7 @@
<span style="color:red; font-style:italic; font-weight:bold">Demo Web Application Only - Do NOT Deploy in Production</span>
</center>
<h1>Servlet 5.0 Demo WebApp</h1>
<h1>Servlet 6.0 Demo WebApp</h1>
<p>This example tests some aspects of the servlet specification:</p>
<ul>
<li>context defaults</li>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<description>Test webapp for JSTL</description>
</web-app>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<display-name>WebApp With Resources</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="4.0">
version="6.0">
<display-name>Test WebApp</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<display-name>Very Simple Bad Websocket Application</display-name>
</web-app>

View File

@ -1,8 +1,7 @@
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Intentionally Bad Init</display-name>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee web-app_5_0.xsd"
version="5.0">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<servlet>
<servlet-name>h1</servlet-name>

View File

@ -1,7 +1,6 @@
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Intentional Deployment Error WebApp</display-name>
</web-app>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="true"
version="3.1">
version="6.0">
<display-name>Test JMX WebApp</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<login-config>
<auth-method>OPENID</auth-method>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>OWB CDI Integration Test WebApp</display-name>
<!-- Required by org.apache.webbeans.servlet.WebBeansConfigurationListener$Auto -->

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<display-name>Very Simple Web Application</display-name>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
</web-app>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
</web-app>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<display-name>Very Simple Websocket Application</display-name>
</web-app>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Weld CDI Integration Test WebApp</display-name>
<listener>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -13,17 +13,19 @@
package org.eclipse.jetty.ee10.webapp;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jetty.util.Loader;
import jakarta.servlet.Servlet;
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.xml.XmlParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
/**
* Descriptor
@ -78,169 +80,27 @@ public class WebDescriptor extends Descriptor
*/
public static XmlParser newParser(boolean validating)
{
XmlParser xmlParser = new XmlParser(validating)
try
{
boolean mapped = false;
return new WebDescriptorParser(validating);
}
catch (IOException e)
{
throw new IllegalStateException("Unable to instantiate WebDescriptorParser", e);
}
}
@Override
protected InputSource resolveEntity(String pid, String sid)
{
if (!mapped)
{
mapResources();
mapped = true;
}
InputSource is = super.resolveEntity(pid, sid);
return is;
}
void mapResources()
{
// set up cache of DTDs and schemas locally
final URL dtd22 = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_2.dtd");
final URL dtd23 = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_3.dtd");
final URL j2ee14xsd = Loader.getRequiredResource("jakarta/servlet/resources/j2ee_1_4.xsd");
final URL javaee5 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_5.xsd");
final URL javaee6 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_6.xsd");
final URL javaee7 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_7.xsd");
final URL javaee8 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_8.xsd");
final URL jakartaee10 = Loader.getRequiredResource("jakarta/servlet/resources/jakartaee_9.xsd");
final URL webapp24xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_4.xsd");
final URL webapp25xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_5.xsd");
final URL webapp30xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_3_0.xsd");
final URL webapp31xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_3_1.xsd");
final URL webapp40xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_4_0.xsd");
final URL webapp50xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_5_0.xsd");
final URL webcommon30xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_3_0.xsd");
final URL webcommon31xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_3_1.xsd");
final URL webcommon40xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_4_0.xsd");
final URL webcommon50xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_5_0.xsd");
final URL webfragment30xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_3_0.xsd");
final URL webfragment31xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_3_1.xsd");
final URL webfragment40xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_4_0.xsd");
final URL webfragment50xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_5_0.xsd");
final URL webservice11xsd = Loader.getRequiredResource("jakarta/servlet/resources/j2ee_web_services_client_1_1.xsd");
final URL webservice12xsd = Loader.getRequiredResource("jakarta/servlet/resources/javaee_web_services_client_1_2.xsd");
final URL webservice13xsd = Loader.getRequiredResource("jakarta/servlet/resources/javaee_web_services_client_1_3.xsd");
final URL webservice14xsd = Loader.getRequiredResource("jakarta/servlet/resources/javaee_web_services_client_1_4.xsd");
final URL webservice20xsd = Loader.getRequiredResource("jakarta/servlet/resources/jakartaee_web_services_client_2_0.xsd");
URL jsp20xsd = null;
URL jsp21xsd = null;
URL jsp22xsd = null;
URL jsp23xsd = null;
URL jsp30xsd = null;
try
{
// try both jakarta/servlet/resources and jakarta/servlet/jsp/resources to load
jsp20xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_0.xsd");
jsp21xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_1.xsd");
jsp22xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_2.xsd");
jsp23xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_3.xsd");
jsp30xsd = Loader.getResource("jakarta/servlet/resources/jsp_3_0.xsd");
}
catch (Exception e)
{
LOG.trace("IGNORED", e);
}
finally
{
if (jsp20xsd == null)
jsp20xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_0.xsd");
if (jsp21xsd == null)
jsp21xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_1.xsd");
if (jsp22xsd == null)
jsp22xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_2.xsd");
if (jsp23xsd == null)
jsp23xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_3.xsd");
if (jsp30xsd == null)
jsp30xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_3_0.xsd");
}
redirectEntity("web-app_2_2.dtd", dtd22);
redirectEntity("-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN", dtd22);
redirectEntity("web.dtd", dtd23);
redirectEntity("web-app_2_3.dtd", dtd23);
redirectEntity("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", dtd23);
redirectEntity("jsp_2_0.xsd", jsp20xsd);
redirectEntity("http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd", jsp20xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/jsp_2_1.xsd", jsp21xsd);
redirectEntity("jsp_2_2.xsd", jsp22xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/jsp_2_2.xsd", jsp22xsd);
redirectEntity("jsp_2_3.xsd", jsp23xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/jsp_2_3.xsd", jsp23xsd);
redirectEntity("jsp_3_0.xsd", jsp30xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/jsp_3_0.xsd", jsp30xsd);
redirectEntity("j2ee_1_4.xsd", j2ee14xsd);
redirectEntity("http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd", j2ee14xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/javaee_5.xsd", javaee5);
redirectEntity("http://java.sun.com/xml/ns/javaee/javaee_6.xsd", javaee6);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd", javaee7);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd", javaee8);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/javaee_9.xsd", jakartaee10);
redirectEntity("web-common_3_0.xsd", webcommon30xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd", webcommon30xsd);
redirectEntity("web-common_3_1.xsd", webcommon31xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd", webcommon31xsd);
redirectEntity("web-common_4_0.xsd", webcommon40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd", webcommon40xsd);
redirectEntity("web-common_5_0.xsd", webcommon50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-common_5_0.xsd", webcommon50xsd);
redirectEntity("web-app_2_4.xsd", webapp24xsd);
redirectEntity("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd", webapp24xsd);
redirectEntity("web-app_2_5.xsd", webapp25xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd", webapp25xsd);
redirectEntity("web-app_3_0.xsd", webapp30xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd", webapp30xsd);
redirectEntity("web-app_3_1.xsd", webapp31xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd", webapp31xsd);
redirectEntity("web-app_4_0.xsd", webapp40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd", webapp40xsd);
redirectEntity("web-app_5_0.xsd", webapp50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd", webapp50xsd);
// Handle linewrap hyphen error in PDF spec
redirectEntity("webapp_4_0.xsd", webapp40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/webapp_4_0.xsd", webapp40xsd);
redirectEntity("webapp_5_0.xsd", webapp50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/webapp_5_0.xsd", webapp50xsd);
// handle jakartaee coordinates
redirectEntity("http://xmlns.eclipse.org/xml/ns/jakartaee/web-app_4_0.xsd", webapp40xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd", webapp50xsd);
redirectEntity("web-fragment_3_0.xsd", webfragment30xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd", webfragment30xsd);
redirectEntity("web-fragment_3_1.xsd", webfragment31xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd", webfragment31xsd);
redirectEntity("web-fragment_4_0.xsd", webfragment40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd", webfragment40xsd);
redirectEntity("web-fragment_5_0.xsd", webfragment50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd", webfragment50xsd);
redirectEntity("j2ee_web_services_client_1_1.xsd", webservice11xsd);
redirectEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd", webservice11xsd);
redirectEntity("javaee_web_services_client_1_2.xsd", webservice12xsd);
redirectEntity("http://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd", webservice12xsd);
redirectEntity("javaee_web_services_client_1_3.xsd", webservice13xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd", webservice13xsd);
redirectEntity("javaee_web_services_client_1_4.xsd", webservice14xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd", webservice14xsd);
redirectEntity("jakartaee_web_services_client_2_0.xsd", webservice20xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_client_2_0.xsd", webservice20xsd);
}
};
return xmlParser;
private static class WebDescriptorParser extends XmlParser
{
public WebDescriptorParser(boolean validating) throws IOException
{
super(validating);
String catalogName = "catalog-%s.xml".formatted(ServletContextHandler.__environment.getName());
URL url = WebDescriptor.class.getResource(catalogName);
if (url == null)
throw new IllegalStateException("Catalog not found: %s/%s".formatted(WebDescriptor.class.getPackageName(), catalogName));
addCatalog(URI.create(url.toExternalForm()), Servlet.class);
}
}
public WebDescriptor(Resource xml)

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!-- 2.2 -->
<public publicId="web-app_2_2.dtd" uri="resources/web-app_2_2.dtd" />
<public publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" uri="resources/web-app_2_2.dtd" />
<!-- 2.3 -->
<public publicId="web-app_2_3.dtd" uri="resources/web-app_2_3.dtd" />
<public publicId="web.dtd" uri="resources/web-app_2_3.dtd" />
<public publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" uri="resources/web-app_2_3.dtd" />
<!-- 2.4 -->
<public publicId="j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<system systemId="http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<system systemId="https://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<public publicId="web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<system systemId="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<system systemId="https://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<public publicId="j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<system systemId="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<system systemId="https://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<!-- 2.5 -->
<public publicId="javaee_5.xsd" uri="resources/javaee_5.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="resources/javaee_5.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="resources/javaee_5.xsd" />
<public publicId="web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<public publicId="javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<system systemId="http://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<system systemId="https://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<!-- 3.0 -->
<public publicId="javaee_6.xsd" uri="resources/javaee_6.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_6.xsd" uri="resources/javaee_6.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_6.xsd" uri="resources/javaee_6.xsd" />
<public publicId="web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<public publicId="web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<public publicId="web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<public publicId="javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<!-- 3.1 -->
<public publicId="javaee_7.xsd" uri="resources/javaee_7.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd" uri="resources/javaee_7.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd" uri="resources/javaee_7.xsd" />
<public publicId="web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<public publicId="web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<public publicId="web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<!-- Servlet 4 -->
<public publicId="javaee_8.xsd" uri="resources/javaee_8.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd" uri="resources/javaee_8.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd" uri="resources/javaee_8.xsd" />
<public publicId="web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<public publicId="web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<public publicId="web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<public publicId="javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<!-- Servlet 5 -->
<!-- These always exist at base jakarta/servlet/ -->
<public publicId="jakartaee_9.xsd" uri="resources/jakartaee_9.xsd" />
<system systemId="http://javax.ee/xml/ns/javaxee/javaee_9.xsd" uri="resources/jakartaee_9.xsd" />
<system systemId="https://javax.ee/xml/ns/javaxee/javaee_9.xsd" uri="resources/jakartaee_9.xsd" />
<public publicId="web-app_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<public publicId="webapp_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/webapp_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<public publicId="web-common_5_0.xsd" uri="resources/web-common_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-common_5_0.xsd" uri="resources/web-common_5_0.xsd" />
<public publicId="web-fragment_5_0.xsd" uri="resources/web-fragment_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd" uri="resources/web-fragment_5_0.xsd" />
<public publicId="jakartaee_web_services_client_2_0.xsd" uri="resources/jakartaee_web_services_client_2_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_client_2_0.xsd" uri="resources/jakartaee_web_services_client_2_0.xsd" />
<!-- Servlet 6 -->
<!-- These always exist at base jakarta/servlet/ -->
<public publicId="web-app_6_0.xsd" uri="resources/web-app_6_0.xsd" />
<public publicId="webapp_6_0.xsd" uri="resources/web-app_6_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" uri="resources/web-app_6_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/webapp_6_0.xsd" uri="resources/web-app_6_0.xsd" />
<public publicId="web-common_6_0.xsd" uri="resources/web-common_6_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-common_6_0.xsd" uri="resources/web-common_6_0.xsd" />
<public publicId="web-fragment_6_0.xsd" uri="resources/web-fragment_6_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_0.xsd" uri="resources/web-fragment_6_0.xsd" />
<public publicId="jakartaee_web_services_client_2_0.xsd" uri="resources/jakartaee_web_services_client_2_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_client_2_0.xsd" uri="resources/jakartaee_web_services_client_2_0.xsd" />
</catalog>

View File

@ -31,10 +31,10 @@ public class WebDescriptorTest
public WorkDir workDir;
/**
* Test to ensure that the XMLParser mapResources is functioning properly.
* Test to ensure that the XMLParser XML entity mapping is functioning properly.
*/
@Test
public void testMapResourcesXmlWithXsd() throws Exception
public void testXmlWithXsd() throws Exception
{
Path xml = workDir.getEmptyPathDir().resolve("test.xml");
Files.writeString(xml, """

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path>/three</default-context-path>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path>/one</default-context-path>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Test 4 WebApp</display-name>
<session-config>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path>/two</default-context-path>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path></default-context-path>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="true"
version="3.1">
version="6.0">
<display-name>Test 31 WebApp</display-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="3.1">
version="6.0">
<display-name>Test 31 WebApp</display-name>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<servlet>
<servlet-name>zedName</servlet-name>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<context-param>
<param-name>org.eclipse.jetty.websocket.jakarta.addDynamicFilter</param-name>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<listener>
<listener-class>org.eclipse.jetty.websocket.jakarta.tests.server.InfoContextAltAttributeListener</listener-class>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<!-- disable Jakarta WebSockets -->
<context-param>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<!-- disable Jakarta Websockets -->
<context-param>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="4.0">
version="6.0">
<filter>
<filter-name>wsuf-alt</filter-name>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
metadata-complete="false"
version="4.0">
version="6.0">
<!-- Add the custom filter first. -->
<filter>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!-- 2.2 -->
<public publicId="web-app_2_2.dtd" uri="resources/web-app_2_2.dtd" />
<public publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" uri="resources/web-app_2_2.dtd" />
<!-- 2.3 -->
<public publicId="web-app_2_3.dtd" uri="resources/web-app_2_3.dtd" />
<public publicId="web.dtd" uri="resources/web-app_2_3.dtd" />
<public publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" uri="resources/web-app_2_3.dtd" />
<!-- 2.4 -->
<public publicId="j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<system systemId="http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<system systemId="https://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<public publicId="web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<system systemId="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<system systemId="https://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<public publicId="j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<system systemId="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<system systemId="https://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<!-- 2.5 -->
<public publicId="javaee_5.xsd" uri="resources/javaee_5.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="resources/javaee_5.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="resources/javaee_5.xsd" />
<public publicId="web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<public publicId="javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<system systemId="http://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<system systemId="https://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<!-- 3.0 -->
<public publicId="javaee_6.xsd" uri="resources/javaee_6.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_6.xsd" uri="resources/javaee_6.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_6.xsd" uri="resources/javaee_6.xsd" />
<public publicId="web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<public publicId="web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<public publicId="web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<public publicId="javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<!-- 3.1 -->
<public publicId="javaee_7.xsd" uri="resources/javaee_7.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd" uri="resources/javaee_7.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd" uri="resources/javaee_7.xsd" />
<public publicId="web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<public publicId="web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<public publicId="web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<!-- Servlet 4 -->
<public publicId="javaee_8.xsd" uri="resources/javaee_8.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd" uri="resources/javaee_8.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd" uri="resources/javaee_8.xsd" />
<public publicId="web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<public publicId="web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<public publicId="web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<public publicId="javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
</catalog>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee web-app_5_0.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">
<servlet>

View File

@ -13,18 +13,19 @@
package org.eclipse.jetty.ee9.webapp;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import jakarta.servlet.Servlet;
import org.eclipse.jetty.ee9.nested.ContextHandler;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.xml.XmlParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
/**
* Descriptor
@ -79,172 +80,27 @@ public class WebDescriptor extends Descriptor
*/
public static XmlParser newParser(boolean validating)
{
XmlParser xmlParser = new XmlParser(validating)
try
{
boolean mapped = false;
return new WebDescriptorParser(validating);
}
catch (IOException e)
{
throw new IllegalStateException("Unable to instantiate WebDescriptorParser", e);
}
}
@Override
protected InputSource resolveEntity(String pid, String sid)
{
if (!mapped)
{
mapResources();
mapped = true;
}
InputSource is = super.resolveEntity(pid, sid);
return is;
}
void mapResources()
{
//set up cache of DTDs and schemas locally
final URL dtd22 = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_2.dtd");
final URL dtd23 = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_3.dtd");
final URL j2ee14xsd = Loader.getRequiredResource("jakarta/servlet/resources/j2ee_1_4.xsd");
final URL javaee5 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_5.xsd");
final URL javaee6 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_6.xsd");
final URL javaee7 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_7.xsd");
final URL javaee8 = Loader.getRequiredResource("jakarta/servlet/resources/javaee_8.xsd");
final URL webapp24xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_4.xsd");
final URL webapp25xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_2_5.xsd");
final URL webapp30xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_3_0.xsd");
final URL webapp31xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_3_1.xsd");
final URL webapp40xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_4_0.xsd");
final URL webcommon30xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_3_0.xsd");
final URL webcommon31xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_3_1.xsd");
final URL webcommon40xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_4_0.xsd");
final URL webfragment30xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_3_0.xsd");
final URL webfragment31xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_3_1.xsd");
final URL webfragment40xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_4_0.xsd");
final URL webservice11xsd = Loader.getRequiredResource("jakarta/servlet/resources/j2ee_web_services_client_1_1.xsd");
final URL webservice12xsd = Loader.getRequiredResource("jakarta/servlet/resources/javaee_web_services_client_1_2.xsd");
final URL webservice13xsd = Loader.getRequiredResource("jakarta/servlet/resources/javaee_web_services_client_1_3.xsd");
final URL webservice14xsd = Loader.getRequiredResource("jakarta/servlet/resources/javaee_web_services_client_1_4.xsd");
URL jsp20xsd = null;
URL jsp21xsd = null;
URL jsp22xsd = null;
URL jsp23xsd = null;
URL jsp30xsd = null;
try
{
//try both jakarta/servlet/resources and jakarta/servlet/jsp/resources to load
jsp20xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_0.xsd");
jsp21xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_1.xsd");
jsp22xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_2.xsd");
jsp23xsd = Loader.getResource("jakarta/servlet/resources/jsp_2_3.xsd");
jsp30xsd = Loader.getResource("jakarta/servlet/resources/jsp_3_0.xsd");
}
catch (Exception e)
{
LOG.trace("IGNORED", e);
}
finally
{
if (jsp20xsd == null)
jsp20xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_0.xsd");
if (jsp21xsd == null)
jsp21xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_1.xsd");
if (jsp22xsd == null)
jsp22xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_2.xsd");
if (jsp23xsd == null)
jsp23xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_2_3.xsd");
if (jsp30xsd == null)
jsp30xsd = Loader.getResource("jakarta/servlet/jsp/resources/jsp_3_0.xsd");
}
// Only process these entities if we are in the "ee9" package.
// This will allow the auto-backport of this class into ee8 to skip the ee9 specific resources
// These resources come from the jakarta.servlet-api-5.0.0.jar
if (ContextHandler.SERVLET_MAJOR_VERSION >= 5)
{
final URL jakartaee9 = Loader.getRequiredResource("jakarta/servlet/resources/jakartaee_9.xsd");
redirectEntity("https://javax.ee/xml/ns/javaxee/javaee_9.xsd", jakartaee9);
final URL webapp50xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-app_5_0.xsd");
redirectEntity("webapp_5_0.xsd", webapp50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/webapp_5_0.xsd", webapp50xsd);
redirectEntity("web-app_5_0.xsd", webapp50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd", webapp50xsd);
final URL webcommon50xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-common_5_0.xsd");
redirectEntity("web-common_5_0.xsd", webcommon50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-common_5_0.xsd", webcommon50xsd);
final URL webfragment50xsd = Loader.getRequiredResource("jakarta/servlet/resources/web-fragment_5_0.xsd");
redirectEntity("web-fragment_5_0.xsd", webfragment50xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd", webfragment50xsd);
final URL webservice20xsd = Loader.getRequiredResource("jakarta/servlet/resources/jakartaee_web_services_client_2_0.xsd");
redirectEntity("jakartaee_web_services_client_2_0.xsd", webservice20xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_client_2_0.xsd", webservice20xsd);
}
redirectEntity("jsp_2_0.xsd", jsp20xsd);
redirectEntity("http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd", jsp20xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/jsp_2_1.xsd", jsp21xsd);
redirectEntity("jsp_2_2.xsd", jsp22xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/jsp_2_2.xsd", jsp22xsd);
redirectEntity("jsp_2_3.xsd", jsp23xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/jsp_2_3.xsd", jsp23xsd);
redirectEntity("jsp_3_0.xsd", jsp30xsd);
redirectEntity("https://jakarta.ee/xml/ns/jakartaee/jsp_3_0.xsd", jsp30xsd);
redirectEntity("j2ee_1_4.xsd", j2ee14xsd);
redirectEntity("http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd", j2ee14xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/javaee_5.xsd", javaee5);
redirectEntity("http://java.sun.com/xml/ns/javaee/javaee_6.xsd", javaee6);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd", javaee7);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd", javaee8);
redirectEntity("web-common_3_0.xsd", webcommon30xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd", webcommon30xsd);
redirectEntity("web-common_3_1.xsd", webcommon31xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd", webcommon31xsd);
redirectEntity("web-common_4_0.xsd", webcommon40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd", webcommon40xsd);
redirectEntity("web-app_2_4.xsd", webapp24xsd);
redirectEntity("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd", webapp24xsd);
redirectEntity("web-app_2_5.xsd", webapp25xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd", webapp25xsd);
redirectEntity("web-app_3_0.xsd", webapp30xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd", webapp30xsd);
redirectEntity("web-app_3_1.xsd", webapp31xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd", webapp31xsd);
redirectEntity("web-app_4_0.xsd", webapp40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd", webapp40xsd);
// Handle linewrap hyphen error in PDF spec
redirectEntity("webapp_4_0.xsd", webapp40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/webapp_4_0.xsd", webapp40xsd);
// handle jakartaee coordinates
redirectEntity("http://xmlns.eclipse.org/xml/ns/jakartaee/web-app_4_0.xsd", webapp40xsd);
redirectEntity("web-fragment_3_0.xsd", webfragment30xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd", webfragment30xsd);
redirectEntity("web-fragment_3_1.xsd", webfragment31xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd", webfragment31xsd);
redirectEntity("web-fragment_4_0.xsd", webfragment40xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd", webfragment40xsd);
redirectEntity("j2ee_web_services_client_1_1.xsd", webservice11xsd);
redirectEntity("http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd", webservice11xsd);
redirectEntity("javaee_web_services_client_1_2.xsd", webservice12xsd);
redirectEntity("http://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd", webservice12xsd);
redirectEntity("javaee_web_services_client_1_3.xsd", webservice13xsd);
redirectEntity("http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd", webservice13xsd);
redirectEntity("javaee_web_services_client_1_4.xsd", webservice14xsd);
redirectEntity("http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd", webservice14xsd);
}
};
return xmlParser;
private static class WebDescriptorParser extends XmlParser
{
public WebDescriptorParser(boolean validating) throws IOException
{
super(validating);
String catalogName = "catalog-%s.xml".formatted(ContextHandler.ENVIRONMENT.getName());
URL url = WebDescriptor.class.getResource(catalogName);
if (url == null)
throw new IllegalStateException("Catalog not found: %s/%s".formatted(WebDescriptor.class.getPackageName(), catalogName));
addCatalog(URI.create(url.toExternalForm()), Servlet.class);
}
}
public WebDescriptor(Resource xml)

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!-- 2.2 -->
<public publicId="web-app_2_2.dtd" uri="resources/web-app_2_2.dtd" />
<public publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" uri="resources/web-app_2_2.dtd" />
<!-- 2.3 -->
<public publicId="web-app_2_3.dtd" uri="resources/web-app_2_3.dtd" />
<public publicId="web.dtd" uri="resources/web-app_2_3.dtd" />
<public publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" uri="resources/web-app_2_3.dtd" />
<!-- 2.4 -->
<public publicId="j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<system systemId="http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<system systemId="https://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" uri="resources/j2ee_1_4.xsd" />
<public publicId="web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<system systemId="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<system systemId="https://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" uri="resources/web-app_2_4.xsd" />
<public publicId="j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<system systemId="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<system systemId="https://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd" uri="resources/j2ee_web_services_client_1_1.xsd" />
<!-- 2.5 -->
<public publicId="javaee_5.xsd" uri="resources/javaee_5.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="resources/javaee_5.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="resources/javaee_5.xsd" />
<public publicId="web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" uri="resources/web-app_2_5.xsd" />
<public publicId="javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<system systemId="http://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<system systemId="https://www.ibm.com/webservices/xsd/javaee_web_services_client_1_2.xsd" uri="resources/javaee_web_services_client_1_2.xsd" />
<!-- 3.0 -->
<public publicId="javaee_6.xsd" uri="resources/javaee_6.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_6.xsd" uri="resources/javaee_6.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_6.xsd" uri="resources/javaee_6.xsd" />
<public publicId="web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" uri="resources/web-app_3_0.xsd" />
<public publicId="web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-common_3_0.xsd" uri="resources/web-common_3_0.xsd" />
<public publicId="web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" uri="resources/web-fragment_3_0.xsd" />
<public publicId="javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<system systemId="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<system systemId="https://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd" uri="resources/javaee_web_services_client_1_3.xsd" />
<!-- 3.1 -->
<public publicId="javaee_7.xsd" uri="resources/javaee_7.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd" uri="resources/javaee_7.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd" uri="resources/javaee_7.xsd" />
<public publicId="web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" uri="resources/web-app_3_1.xsd" />
<public publicId="web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-common_3_1.xsd" uri="resources/web-common_3_1.xsd" />
<public publicId="web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd" uri="resources/web-fragment_3_1.xsd" />
<!-- Servlet 4 -->
<public publicId="javaee_8.xsd" uri="resources/javaee_8.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd" uri="resources/javaee_8.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_8.xsd" uri="resources/javaee_8.xsd" />
<public publicId="web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" uri="resources/web-app_4_0.xsd" />
<public publicId="web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-common_4_0.xsd" uri="resources/web-common_4_0.xsd" />
<public publicId="web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/web-fragment_4_0.xsd" uri="resources/web-fragment_4_0.xsd" />
<public publicId="javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<system systemId="http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<system systemId="https://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_client_1_4.xsd" uri="resources/javaee_web_services_client_1_4.xsd" />
<!-- Servlet 5 -->
<!-- These always exist at base jakarta/servlet/ -->
<public publicId="jakartaee_9.xsd" uri="resources/jakartaee_9.xsd" />
<system systemId="http://javax.ee/xml/ns/javaxee/javaee_9.xsd" uri="resources/jakartaee_9.xsd" />
<system systemId="https://javax.ee/xml/ns/javaxee/javaee_9.xsd" uri="resources/jakartaee_9.xsd" />
<public publicId="web-app_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<public publicId="webapp_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/webapp_5_0.xsd" uri="resources/web-app_5_0.xsd" />
<public publicId="web-common_5_0.xsd" uri="resources/web-common_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-common_5_0.xsd" uri="resources/web-common_5_0.xsd" />
<public publicId="web-fragment_5_0.xsd" uri="resources/web-fragment_5_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd" uri="resources/web-fragment_5_0.xsd" />
<public publicId="jakartaee_web_services_client_2_0.xsd" uri="resources/jakartaee_web_services_client_2_0.xsd" />
<system systemId="https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_client_2_0.xsd" uri="resources/jakartaee_web_services_client_2_0.xsd" />
</catalog>

View File

@ -31,10 +31,10 @@ public class WebDescriptorTest
public WorkDir workDir;
/**
* Test to ensure that the XMLParser mapResources is functioning properly.
* Test to ensure that the XMLParser XML entity mapping is functioning properly.
*/
@Test
public void testMapResourcesXmlWithXsd() throws Exception
public void testXmlWithXsd() throws Exception
{
Path xml = workDir.getEmptyPathDir().resolve("test.xml");
Files.writeString(xml, """

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path>/three</default-context-path>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path>/one</default-context-path>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>Test 4 WebApp</display-name>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path>/two</default-context-path>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_4_0.xsd"
version="4.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>Test 4 WebApp</display-name>
<default-context-path></default-context-path>