一、项目说明
1.1 结构说明
- 项目提供与 Servlet 整合的两种方式,一种是 Servlet 3.0 原生的注解方式,一种是采用 Spring 注册的方式;
- Servlet、过滤器、监听器分别位于 servlet、filter、listen 下,其中以 Annotation 命名结尾的代表是 Servlet 是以注解方式实现,采用 Spring 注册方式则需要在 ServletConfig 中进行注册;
- 为了说明外置容器对 Servlet 注解的自动发现机制,项目采用外置容器构建,关于 Spring Boot 整合外置容器的详细说明可以参考:spring-boot-tomcat 。
1.2 项目依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency