相关疑难解决方法(0)

获取错误:元素类型"web-app"的内容必须匹配,

当我在Eclipse Helios Service Release 2中构建我的项目时,我的错误web.xml.请建议我为此做些什么.在我的项目中,我使用的是DTD 2.2.错误如下.

元素类型"web-app"的内容必须匹配"(icon?,display-name ?, description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime- mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".

web.xml servlets

39
推荐指数
1
解决办法
3万
查看次数

元素类型"..."的内容必须在web.xml中匹配

我的web.xml文件有问题.错误:

元素类型"web-app"的内容必须匹配"(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进入*,EJB-REF*,EJB本地-REF*)".

但是,我的web.xml文件按错误说的顺序排列.

这是我的web.xml:

<!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>
    <display-name>Archetype Created Web Application</display-name>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    </context-param>
      
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
        <description></description>
    </context-param>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
      
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>

    <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>
Run Code Online (Sandbox Code Playgroud)

我使用WebLogic 10.3.4.对这个问题有什么看法吗?

eclipse web.xml

35
推荐指数
4
解决办法
5万
查看次数

标签 统计

web.xml ×2

eclipse ×1

servlets ×1