the order of the elements of the web.xml file are wrong
cheers,
JeanLuc
-----Message d'origine-----
De?: Edward [mailto:zhangsc@n...]
Envoy=A8=A6?: vendredi 31 mai 2002 10:29
=A8=A4?: Java 2 Enterprise Edition
Objet?: [j2ee] Why my web.xml is error?
Importance?: Haute
Hello,
I have a question about servlet's web.xml file,I put my files into
follows
directories:
D:\Apache Tomcat
4.0\webapps\login\WEB-INF\classes\GetUserIdentity.class
D:\Apache Tomcat 4.0\webapps\login\WEB-INF\web.xml
D:\Apache Tomcat 4.0\webapps\login\servlets\index.html
My web.xml is follows:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.html
</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>
GetUserIdentity
</servlet-name>
<servlet-class>
GetUserIdentity
</servlet-class>
</servlet>
</web-app> //---------Here is 24 line---------
When I start Tomcat4.0,I got error:
Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
PARSE error at line 24 column 12
org.xml.sax.SAXParseException: The content of element type "web-app"
must
match
"(icon?,display-name?,description?,distributable?,context-param*,filter*
,fil
ter-
mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin
g*,w
elco
me-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,securi
ty-c
onst
raint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)"
.
Starting service Tomcat-Apache
Apache Tomcat/4.0.1
I don't know why my web.xml is error,how to correct it?
Thanks!
Edward