网络应用程序 web.xml 错误 [英] web app web.xml error

查看:25
本文介绍了网络应用程序 web.xml 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Eclipse 中开发的 GWT 应用程序出错.它位于 web.xml 文件中.这是错误:

I am getting an error in my GWT application being developed in Eclipse. It's in the web.xml file. Here's the error:

The content of element type "web-app" must match "(icon?,display-   name?,description?,distributable?,context-
     param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-
     file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-
     role*,env-entry*,ejb-ref*,ejb-local-ref*)".

我看过很多关于这个的帖子,问题是文件元素的顺序,但这个修复对我不起作用(我也试过把所有的 <servlet-mapping> 标签紧跟在相应的 之后,它也不起作用)

I have seen numerous posts about this and the problem is the order of the elements of the file, but that fix doesn't work for me (I have also tried putting all the <servlet-mapping> tags right after the corresponding <servlet>, it did not work either)

我的 web.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

  <servlet>
    <servlet-name>dispatch</servlet-name>
    <servlet-class>com.yachtcloser.server.DispatchServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>upload</servlet-name>
    <servlet-class>com.yachtcloser.server.UploadServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet> 

  <servlet>
    <servlet-name>download</servlet-name>
    <servlet-class>com.yachtcloser.server.DownloadServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>login</servlet-name>
    <servlet-class>com.yachtcloser.server.LoginServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>dispatch</servlet-name>
    <url-pattern>/dispatch.do</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>upload</servlet-name>
    <url-pattern>/upload.do</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>download</servlet-name>
    <url-pattern>/download.do</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>/login.do</url-pattern>
  </servlet-mapping>

  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>Yc.html</welcome-file>
  </welcome-file-list>

</web-app>

是否有其他方法可以跟踪此错误;与此链接的其他文件?

Are there any other ways of tracking this error; other files that are linked to this?

推荐答案

我删除了文件并将旧文件中的文本粘贴到同名的新文件中,现在没有错误.

I deleted the file and pasted the text from the old one into a new file with the same name and now there's no errors.

这篇关于网络应用程序 web.xml 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆