• Stars
    star
    149
  • Rank 243,958 (Top 5 %)
  • Language
    Java
  • License
    GNU General Publi...
  • Created almost 7 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

一个基于Netty实现的Spring Boot内置Servlet容器。a Spring Boot embedded servlet container project base on netty API (4.1.12.Final).

spring-boot-starter-netty

[English] [中文]

Introduction

This is a Spring Boot embedded servlet container project base on netty API (4.1.12.Final).
This project has been publish into maven center repository, refer to The Central Repository.

Maven Dependencies

  1. add the dependencies below to your maven project:
<dependencies>
    <!-- exludes embedded Tomcat -->
    <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>
    <!-- include this netty servlet container -->
    <dependency>
        <groupId>io.gitlab.leibnizhu</groupId>
        <artifactId>spring-boot-starter-netty</artifactId>
        <version>1.1</version>
    </dependency>
</dependencies>
  1. add scanBasePackages property to @SpringBootApplication annotation in your Spring-Boot entry class, like:
@SpringBootApplication(scanBasePackages = {"io.gitlab.leibnizhu", "your.package.name"})
@EnableScheduling
public class AwpApplication extends SpringBootServletInitializer {
    public AwpApplication() {
    }

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(new Class[]{AwpApplication.class});
    }

    public static void main(String[] args) {
        SpringApplication.run(AwpApplication.class, args);
    }
}
  1. run your Spring-Boot application and enjoy it.

Blogs about how to design/code this project

Only Chineses, updating one after another……
基于Netty的Spring Boot内置Servlet容器的实现(一)
基于Netty的Spring Boot内置Servlet容器的实现(二)
基于Netty的Spring Boot内置Servlet容器的实现(三)
基于Netty的Spring Boot内置Servlet容器的实现(四)
基于Netty的Spring Boot内置Servlet容器的实现(五)