MyEclipse 下新建Servlet后,对应的xml文件直接报错的解决办法

来源:互联网 发布:汉语拼音软件下载 编辑:程序博客网 时间:2024/06/16 07:53

 1 . 本人使用的是MyEclipse 2016 ,在新建Java Web项目后,新建Serlvet文件,未作修改,对应的xml文件直接报错。 错误提示为下列语句,xml文件截图如下


 Referenced file contains errors (http://java.sun.com/xml/ns/java2ee/web-app_2_5.xsd). For 
 more information, right click on the message in the Problems View and select "Show Details..."



 改了半天办法,都没有办法,最后发现,将xml中的xsi:schemaLocation 中的java2ee改为 javaee 保存即可。


<?xml version="1.0" encoding="UTF-8"?>
<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/java2ee/web-app_2_5.xsd">







0 0
原创粉丝点击