(三)——Servlet

 1 package my.tomcat2;
 2 
 3 import java.net.Socket;
 4 
 5 /**
 6  * 用来封装 Request 和 Response,也就是客户端发来的请求和回应
 7  */
 8 public abstract class Servlet {
 9 
10     protected void service(Request request, Response response){
11         this.doGet(request, response);
12         this.doPost(request, response);
13     }
14 
15     protected abstract void doGet(Request request, Response response);
16     protected abstract void doPost(Request request, Response response);
17 }

 

posted @ 2018-09-07 20:02  一凡夫一俗子  阅读(84)  评论(0编辑  收藏  举报