在servlet 3.0之前,需要通过提供url模式和servlet类在web.xml中配置servlet.每当发送对servlet的请求时,tomcat都会在web.xml中搜索servlet类,并根据请求的类型调用doget或dopost.在servlet 3.0中,我们可以使用@WebServlet之类的注释在servlet类本身中配置servlet.我的问题是在这种情况下tomcat如何识别servlet类,因为在web.xml中没有为servlet指定的映射.
提前致谢.
java tomcat servlets
java ×1
servlets ×1
tomcat ×1