因为第一种实现javax.servlet.Servlet接口,必须重写该接口下的所有方法,略显冗余,所以继承javax.servet.GenericServlet类(适配器模式),只需要覆写每次都需要调用的service()方法。比较简便。