Servlet接口的主要作用是提供Servlet生命周期的init()、service()和destroy()方法。
servlet接口中的主要方法有:
void init(ServletConfit config)throws ServletException 在servlet被载入后和实施服务前由servlet引擎进行一次性调用。如果init()产生溢出UnavailableException,则 servle退出服务。
ServletConfig getServletConfig() 返回传递到servlet的init()方法的ServletConfig对象
String getServletInfo() 返回描述servlet的一个字符串
void destory() 当servlet将要卸载时由servlet引擎调用,销毁Servlet实例。