基于netty手写Tomcat
作者: MovW 原文:http://suo.im/5Ar7t8 netty 简介 Netty一个基于NIO的客户、服务器端的编程框架 1.环境准备 maven依赖 <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.42.Final</version> </dependency> 12345 RequestMethodEnum 请求方式 public enum RequestMethodEnum { GET( "GET" ), POST( "POST" ); public String code; RequestMethodEnum(String code) { this.code=code; }}12345678 ParentServlet 父类servlet public abstract class ParentServlet { public void service(ParentRequest request, ParentResponse response) throws Exception { //service 方法决定调用doGet、doPost; if (RequestMethodEnum.GET.code