servlet 3.0 @WebServlet use..what将在web.xml中?

use*_*920 12 servlets servlet-3.0

我想知道使用带有Tomcat 7的servlet 3.0的目录结构.我使用了没有初始化参数的注释@WebServlet.

我想知道web.xml文件中要写的是什么?是否还有待写......

该文件存储在tomcat的classes文件夹中.

Tom*_*icz 24

这就是您所需要的web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  version="3.0">
Run Code Online (Sandbox Code Playgroud)

3.0兼容的servlet容器(如Tomcat 7)会@WebServlet自动找到.