Skip to content

Commit

Permalink
Issue #5752 Fix quickstart for servlet 5 schema locations
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bartel <janb@webtide.com>
  • Loading branch information
janbartel committed Dec 7, 2020
1 parent 1c9cabe commit aca3722
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -154,9 +154,13 @@ public void generateQuickStartWebXml(WebAppContext context, OutputStream stream)
Map<String, String> webappAttr = new HashMap<>();
int major = context.getServletContext().getEffectiveMajorVersion();
int minor = context.getServletContext().getEffectiveMinorVersion();
webappAttr.put("xmlns", "http://xmlns.jcp.org/xml/ns/javaee");
String ns = "https://jakarta.ee/xml/ns/jakartaee";
if (major < 5)
ns = "http://xmlns.jcp.org/xml/ns/javaee";

webappAttr.put("xmlns", ns);
webappAttr.put("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
webappAttr.put("xsi:schemaLocation", "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_" + (major + "_" + minor) + ".xsd");
webappAttr.put("xsi:schemaLocation", ns + " " + ns + "/web-app_" + (major + "_" + minor) + ".xsd");
webappAttr.put("metadata-complete", Boolean.toString(context.getMetaData().isMetaDataComplete()));
webappAttr.put("version", major + "." + minor);

Expand Down

0 comments on commit aca3722

Please sign in to comment.