深入解析Servlet实现方式:JSP应用基础课堂回顾
深入探讨:Servlet有几种途径可以实现?
1. 通过实现Servlet接口,创建tServlet类并重写service方法,同时在web.xml中配置。
2. 继承GenericServlet类,再定制tServlet类以重写service方法,并在web.xml中进行配置。
3. 继承HttpServlet类,重写doGet和doPost方法,同时通过web.xml进行配置。
1. 通过实现Servlet接口,创建tServlet类并重写service方法,同时在web.xml中配置。
2. 继承GenericServlet类,再定制tServlet类以重写service方法,并在web.xml中进行配置。
3. 继承HttpServlet类,重写doGet和doPost方法,同时通过web.xml进行配置。
下载地址
用户评论