This commit is contained in:
Jan Bartel 2017-09-27 14:32:14 +10:00
parent d81b835ad0
commit 2555f7a65b
1 changed files with 4 additions and 2 deletions

View File

@ -172,11 +172,13 @@ public class QuickStartGeneratorConfiguration extends AbstractConfiguration
MetaData md = context.getMetaData(); MetaData md = context.getMetaData();
Map<String, String> webappAttr = new HashMap<>(); 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"); webappAttr.put("xmlns","http://xmlns.jcp.org/xml/ns/javaee");
webappAttr.put("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"); 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_3_1.xsd"); 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("metadata-complete","true"); webappAttr.put("metadata-complete","true");
webappAttr.put("version",context.getServletContext().getEffectiveMajorVersion()+"."+context.getServletContext().getEffectiveMinorVersion()); webappAttr.put("version",major+"."+minor);
out.openTag("web-app",webappAttr); out.openTag("web-app",webappAttr);
if (context.getDisplayName() != null) if (context.getDisplayName() != null)