编译 报错

坟墓里的爱情 2014-07-10 09:57:05
新建一个动态web项目,web.xml的第一行报错,但是好像不影响程序运行

<?xml version="1.0" encoding="UTF-8"?>

错误内容如下:
The errors below were detected when validating the file "javaee_6.xsd" via the file "web.xml". In most cases these errors can be detected by validating "javaee_6.xsd" directly. However it is possible that errors will only occur when javaee_6.xsd is validated in the context of web.xml.
...全文
4074 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
坟墓里的爱情 2014-07-10
  • 打赏
  • 举报
回复
但是不清楚为什么,请指教
坟墓里的爱情 2014-07-10
  • 打赏
  • 举报
回复
报错的文件
<?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" 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">
  <display-name>aa</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    
  </welcome-file-list>
</web-app>
第二行改成下面的样子就不报错了
<?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/web-app_2_5.xsd" 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">
  <display-name>0001</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>
下面正确的文件是Version: Juno Release的eclipse自动生成的 上面报错的是Release2
姜小白- 2014-07-10
  • 打赏
  • 举报
回复
web.xml 是用eclipse自动生成的吗?还是自己从别的地方拷贝修改的,重点是javaee_6.xsd 哪里来的?

67,550

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧