Eclipse报错(Attribute "xmlns" was already specified for element "web-app".)

宝剑锋从磨砺出,梅花香自苦寒来。这篇文章主要讲述Eclipse报错:Attribute " xmlns" was already specified for element " web-app" .相关的知识,希望能为你提供帮助。
原因:
在Eclipse中修改了已有的Web工程的工程名,然后出现该错误。
Attribute "xmlns" was already specified for element "web-app".
 
检查web.xml文件:
< ?xml version="1.0" encoding="UTF-8"?>
< web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" 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">


确实是出现了两次:xmlns="http://java.sun.com/xml/ns/javaee"
 
解决方法:
【Eclipse报错(Attribute " xmlns" was already specified for element " web-app" .)】删掉一个即可。




    推荐阅读