我的web.xml文件有问题。错误:元素类型“...”的内容必须在web.xml中匹配
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*)".
但是,我的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>
我使用WebLogic 10.3.4。有关这个问题的任何想法?
是的,这个文件的顺序把我定期的拧紧了。根据你发布的DTD片段,welcome-file-list应该出现在servlet和servlet映射之后。试试看。 – Faelkle
不,这不是问题。标签的顺序完全适合DTD。 – erencan
好吗? [the DTD](http://svn.apache.org/repos/asf/beehive/trunk/netui/external/struts/web-app_2_3.dtd)指出'welcome-file-list'在'servlet-映射“ - 它后来在逗号分隔的元素列表中。 – Faelkle