web.xml配置文件中true报错的解决方案


 

   在配置web.xml的时候总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉。 
   可以尝试以下两种解决方式:

   解决方法一:
          在eclipse中配置xml
         1、 http://www.springmodules.org/schema/cache/springmodules-cache.xsd
         2、http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd 
           然后再将这两个xsd加入到web.xml中就搞定了 ,如下面代码:

    

 

   

      解决方法二:

        <async-supported>true</async-supported>是web.xml 3.0的新特性,只需将

       <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

     改成:

         <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

   即可解决。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM