Java–cvc-complex-type.4:attribut ' version ' must appear on element ' Web-app '

Source: Internet
Author: User

Problem Resolution:
In the following code in Web. xml

<xmlns= "Http://java.sun.com/xml/ns/j2ee"  xmlns:xsi= "http// Www.w3.org/2001/XMLSchema-instance "  xsi:schemalocation=" Http://java.sun.com/xml/ns/j2ee http:/ /java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "  ID=" webapp_id ">

Because the Web-app tag does not specify version, a red "X" appears at this point.
However, this error does not cause the program to run correctly.
Workaround Two kinds:
Method one, specify version.

<version= "3.0"   ... >

(PS: There is no detailed understanding of some of the differences after the specified version, or there will be some problems with other project deployments after specifying a version.) Anyway, my side is normal for the time being, if there is a mistake, I'll record it here. )

Method Two, temporarily turn off the validation of eclipse for XML.
XML authoring conforms to specifications, validated through XML schemas or DTDs, but sometimes some XML errors do not cause the entire project to run, and while "X" is displayed in the project, we can first turn off Eclipse's validation of XML. But this is certainly not the best way to solve the problem.
Operation Method: (borrowed from, directly copied)
1. Menu "Windows"-"preperences"-"Validation"?
2. Find "XML Validator" on the right, and leave the "Bulid" check box selected, and leave the "Manual" selected state.
(PS: Because we finally need to ensure the correctness of the XML, this can be done by selecting the XML file, in the right-click menu, select "Validate" manually to verify that if the XML is wrong, will pop-up window prompt. But if the "Manual" check box is also canceled, and then manually verify, even if the XML is really wrong, it will not be correctly prompted. )

The operation is as follows:

Java–cvc-complex-type.4:attribut ' version ' must appear on element ' Web-app '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.