1.在web.xml中配置

005.Servlet配置的俩种方式_注解配置

 

 2.使用注解

从Servlet3.0版本后支持注解配置,可以省去web.xml直接在类上使用@WebServlet注解,进行配置。

005.Servlet配置的俩种方式_注解配置_02