spring boot 2.x 系列 —— spring boot 整合 servlet 3.0

一、项目说明

1.1 结构说明

  • 项目提供与 Servlet 整合的两种方式,一种是 Servlet 3.0 原生的注解方式,一种是采用 Spring 注册的方式;
  • Servlet、过滤器、监听器分别位于 servlet、filter、listen 下,其中以 Annotation 命名结尾的代表是 Servlet 是以注解方式实现,采用 Spring 注册方式则需要在 ServletConfig 中进行注册;
  • 为了说明外置容器对 Servlet 注解的自动发现机制,项目采用外置容器构建,关于 Spring Boot 整合外置容器的详细说明可以参考:spring-boot-tomcat

https://github.com/heibaiying

1.2 项目依赖

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <!--排除依赖 使用外部 tomcat 容器启动-->
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <!--使用外置容器时候 SpringBootServletInitializer 依赖此包 -->
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <!--servlet api 注解依赖包-->
    <dependency
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值