zoukankan      html  css  js  c++  java
  • HttpServlet实现serializable

    Java Servlet Technology Overview

    Servlets are the Java platform technology of choice for extending and enhancing Web servers. Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are server- and platform-independent. This leaves you free to select a "best of breed" strategy for your servers, platforms, and tools.

    Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection. 

    Today servlets are a popular choice for building interactive Web applications. Third-party servlet containers are available for Apache Web Server, Microsoft IIS, and others. Servlet containers are usually a component of Web and application servers, such as BEA WebLogic Application Server, IBM WebSphere, Sun Java System Web Server, Sun Java System Application Server, and others. 

    You might want to check out the latest information on JavaServer Pages (JSP) technology. JSP technology is an extension of the servlet technology created to support authoring of HTML and XML pages. It makes it easier to combine fixed or static template data with dynamic content. Even if you're comfortable writing servlets, there are several compelling reasons to investigate JSP technology as a complement to your existing work.
     
    How a Servlet is Loaded and Instantiated
    The servlet engine instantiates and loads a servlet. The instantiation and loading can
    occur when the engine starts, when it needs the servlet in order to respond to a
    request, or any time in between.
    The servlet engine loads a servlet using the Java class loading facility. The servlet
    engine can load the servlet from the local file system, a remote file system, or a
    network source
    .
     
    How a Servlet is Destroyed
    The servlet engine is not required to keep a servlet loaded for any period of time or
    for the life of the server. Servlet engines are free to use servlets or retire them at any
    time. Therefore, you should not rely on class or instance members to store state
    information.
    When the servlet engine determines that a servlet should be destroyed (for example,
    if the engine is shut down or needs to conserve resources), the engine must allow the
    servlet to release any resources it is using and save persistent state. To do this, the
    engine calls the servlet’s destroy method.
    The servlet engine must allow any calls to the service method either to complete
    or to end with a time out (as the engine defines a time out) before the engine can
    destroy the servlet. Once the engine destroys a servlet, the engine cannot route any
    more requests to the servlet. The engine must release the servlet and make it eligible
    for garbage collection.
  • 相关阅读:
    RPC细谈
    RPC浅谈
    动态规划
    libco 的定时器实现: 时间轮
    一次HTTP请求的完整过程——协议篇(DNS、TCP、HTTP)
    多个CPU、多核CPU以及超线程(Hyper-Threading)
    Linux下which、whereis、locate、find命令的区别
    warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
    使用OutputDebugString输出调试信息
    VS或windows用代码产生GUID
  • 原文地址:https://www.cnblogs.com/djoel/p/5870882.html
Copyright © 2011-2022 走看看