to smartzhang(每天多学一点) :
我把.class文件copy到 \webapps\examples\WEB-INF\classes目录里
没有改任何的设置(包括web.xml),就可以访问servlet了,一点问题也没有
所以我怀疑你说的那些是不是minimal configuration necessary to run my servlet
web.xml is the web application deployment descriptor. It defines everything about your application that a server needs to know.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
This is the minimal configuration necessary to run your servlet.
The tags servlet and servlet-mapping are associated with each other by the common tag servlet-name which uniquely identifies a particular servlet.
The servlet-class tag within servlet contains a fully qualified name of a servlet class. The url-pattern tag within servlet-mapping translates a particular request URI to the specified servlet class.
In the section How to call your web application from browser you will learn how to use this mapping.