解决方案 »

  1.   

    <web-app version="2.4" 
    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">
    这一段报的一下错误:
    Multiple annotations found at this line:
    - Attribute "xmlns:xsi" must be declared for element type "web-app".
    - Attribute "version" must be declared for element type "web-app".
    - Attribute "xsi:schemaLocation" must be declared for element type "web-app".
    - The content of element type "web-app" must match "(icon?,display-
     name?,description?,distributable?,context-param*,filter*,filter-
     mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-
     list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-
     config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
    - cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the 
     type's content type is element-only.
    - Attribute "xmlns" must be declared for element type "web-app".
      

  2.   


    <web-app version="2.5" 
    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_2_5.xsd">
      

  3.   

    web-app 定义的子元素不在xsd规定的范围以内,你看看是不是写错了!