true in web.xml

后端 未结 1 1856
执念已碎
执念已碎 2021-01-06 06:33

Someone help me plss, i got this error when i put async-supported tag in web.xml:

cvc-complex-type.2.4.a: Invalid content was found starting with elem

1条回答
  •  自闭症患者
    2021-01-06 07:15

    The web.xml goes of an XML schema. If you're not familiar with XML schemas, they describe what elements and attributes an XML document can contain in order to be a valid instance of that schema.

    That being said, you can see in the schema location the version of the schema file being used, i.e. ...web-app_2_5.xsd. This means that your web.xml is going to be based on that version of the schema, which maps to that version of the servlet specification, which in your case is 2.5. The problem with this is that async is not introduced to the servlet spec until 3.0. So there is no element specification in the 2.5 schema. So when the xml is being validated, it's saying that not such element is allowed in the document, as it doesn't comply to the schema.

    To fix it, just change the version to 3.0 and the schema file to 3_0

             
    
                                              
    

    0 讨论(0)
提交回复
热议问题