The Java Servlet architecture

Servlet architecture

  Architecture Illustration:

   

   1, Servlet Interface

    If the direct implementation of this interface, you need to rewrite all the way inside, but only need to use the service () method, the other is not commonly used.

   2, GenericServlet abstract class

    The Servlet interface are other ways to do a default empty implementation, only the service () method as an abstract    

    If you extend this class, you need to rewrite the inside of the service () method can be, but for still do not know what way to get data transmitted from the client.

   3, HttpServlet abstract class

    H ttpServlet A package of http protocol, simplify operations, and the need to rewrite only used doGet () and doPost () method can be.

Guess you like

Origin www.cnblogs.com/niujifei/p/11618497.html