1. 程式人生 > >"Referenced file contains errors (http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd). For more informa

"Referenced file contains errors (http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd). For more informa

在web.xml中出現:"Referenced file contains errors (http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd). For more information ,right click on the messege and sel...

解決方法:

1、將j2ee改為javaee 

2、 行數變為5行

<web-app version="3.0"
         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">

3、 其中http://java.sun.com/xml/ns/javaee和 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"的順序不能顛倒,不然也容易出錯(試出來的效果)