Protocol independent servlet: protocol independent servlet can execute on any protocol.
we find servlet as protocol independent servlet if extends GenericServletClass and overrides 3 different methods as 1-public void init() 2-public void service(ServletRequest req , ServeletResponse Res) 3-public void destroy
the GenericServletClass belongs to javax.Servlet package and that implements the servlet and servlet config Interface.
public void init() :this method overrides this public void init(ServeletConfig config); this method executes only once per servlet and says to container that servlet is ready to get any request.
public void service(): the service method executes whenever end user sends a request. and it returns the response to the end user after execution. this method executes n number of time on a particular servlet.
destroy method: when ever no more service is required from the end user, destroy method executes.