zoukankan      html  css  js  c++  java
  • 读书笔记Review: servlet lifecycle and API

    1. The Container initializes a servlet by loading the class,invoking the servlet's no-arg constructor,and calling the servelt's init() method.
    2. The init() method (which the developer can override) is called only once in a servlet's life,and always before the servlet can service any client requests.
    3. The init() method gives the servlet access to the ServletConfig and ServletContext objects,which the servlet needs to get information about the servlet configuration and the web app.
    4. The Container ends a servlet's life by calling its destroy() method.
    5. Most of a servlet's life is spent running a service() method for a client request.
    6. Every request to a servlet runs in a separate thread! There is only one instance of any particular servlet class.
    7. Your servlet will almost always extend javax.servlet.http.HttpServlet,from which in inherits an implementation of the service() method that takes an HttpServeltRequest and an HttpServletResponse
    8. HttpServlet extends javax.GenericServlet-an abstract class that implements most of the basic servlet methods.
    9. GenericServlet implments the Servlet interface.
    10. Servlet classes (except those related to JSPs) are in one of two packages:javax.servlet or javax.servlet.http.
    11. You can override the init() method,and you must override at least one service method(doGet(),doPost(),etc).

  • 相关阅读:
    jquery validate 自定义验证方法 日期验证
    转:前端控制器是邪恶的么?
    eclipse打开文件位置Open Explorer 插件
    Eclipse标准版安装J2EE
    短网址生成思路算法
    smarty模板执行原理
    Smarty 变量使用
    Php模板引擎Smarty安装和配置
    转:PHP分页技术的代码和示例
    黑板架构模式及其常见实现方式
  • 原文地址:https://www.cnblogs.com/yql1986/p/2001358.html
Copyright © 2011-2022 走看看