The IDEA seems incompatible with the xml schema of the API 3.0 servlet, however, is my web application deploying normally?

web.xml

I can easily deploy my web application from IDEA using annotation-based url mappings, so why does IDEA still highlight the tag as a violation of the schema definition here?

(using IDEA 12.1.4, Tomcat 7)

+4
source share
1 answer

IDEA validates your XML according to the schema and correctly says that Element metadata-complete is not allowed here .

If you look at the web-app_3.0.xsd , you will see that it imports web-commmon_3.0.xsd . And this web-common schema defined metadata-complete as part of web-common-attributes .

 <xsd:attributeGroup name="web-common-attributes"> <xsd:attribute name="version" type="javaee:web-app-versionType" use="required"/> <xsd:attribute name="id" type="xsd:ID"/> <xsd:attribute name="metadata-complete" type="xsd:boolean"> ... 

In the end, this means that metadata-complete is an attribute before the web-app .

Change xml instead:

 <?xml version=1.0 encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3.0.xsd" version="3.0" metadata-complete="false"> <display-name>Hello World</display-name> </web-app> 
+5
source

Source: https://habr.com/ru/post/1486488/


All Articles