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.
 

HttpServlet实现serializable的更多相关文章

  1. Servlet/JSP-03 HttpServlet

    一. GenericServlet GenericServlet本身是一个抽象类,并且实现了Servlet和ServletConfig接口 其在内部定义了一个私有的ServletConfig类型的变量 ...

  2. Java Servlet(五):GenericServlet与Servlet、HttpServlet之间的关系(jdk7+tomcat7+eclipse)

    本篇主要记录下,对GenericServlet的作用理解,及其与Servlet/HttpServlet之间的关系. 示例完成业务: 1.新建一个login.jsp页面,要求改页面能输入username ...

  3. javaWEB总结(10):HttpServlet成长史

    前言: 从Servlet,ServletConfig到GenericServlet再到Httpservlet的整个过程,相当于Httpservlet的成长史,我们不需要写那么臃肿的代码,开发难度由复杂 ...

  4. javaWEB总结(7):HttpServlet和HttpServletRequest

    前言:HttpServletRequest对象封装了客户端进行HTTP协议请求时的所有信息,HttpServletRequest继承了ServletRequest,所以和ServletRequest一 ...

  5. Servlet】(2)有关Servlet实现的几个类:GenericServlet、HttpServlet、ServletConfig、ServletContext

    一.GenericServlet 1.所有的成员方法: 1.在javaWeb项目中: 2.web.xml <?xml version="1.0" encoding=" ...

  6. 浅析Java源码之HttpServlet

    纯粹是闲的,在慕课网看了几集的Servlet入门,刚写了1个小demo,就想看看源码,好在也不难 主要是介绍一下里面的主要方法,真的没什么内容啊~ 源码来源于apache-tomcat-7.0.52, ...

  7. servlet(一):从Sevlet到HttpServlet

    Java Servlet 是运行在 Web 服务器或应用服务器上的程序,它是作为来自 Web 浏览器或其他 HTTP 客户端的请求和 HTTP 服务器上的数据库或应用程序之间的中间层. servlet ...

  8. 超全面的JavaWeb笔记day09<Servlet&GenericServlet&HttpServlet&ServletContext>

    1.Servlet概述 2.Servlet接口 3.GenericServlet 4.HttpServlet 5.Servlet细节 6.ServletContext(重要) Servlet概述 生命 ...

  9. Httpservlet源码说明

    上一篇看了Servlet接口,现在来看下我们经常涉及的Httpservlet: /** * * Provides an abstract class to be subclassed to creat ...

随机推荐

  1. ntopng基础

    当你在本地网络监控网络流量,根据流量大小.监控平台/接口.数据库类型等等,可以有许多不同的选择.ntopng是一套开源(遵循GPLv3协议)网络流量分析解决方案,提供基于web界面的实时网络流量监控. ...

  2. GITLAB服务基础

    1.GITLAB介绍 一个基于GIT的源码托管解决方案基于Ruby on rails开发集成了nginx postgreSQL redis sidekiq等组件 2. 资源 官网:https://ab ...

  3. Codeforces441B_Valera and Fruits(暴力)

    Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  4. 对BeforeSuite和BeforeTest的理解

    在BeforeSuite.BeforeTest.BeforeClass.BeforeMethod及BeforeGroups中,后面三个注解都比较好理解,其实BeforeSuite.BeforeTest ...

  5. dijstra算法,求源点到各个顶点的最短距离

    1:dijstra算法常用语求最短距离, dijstra每次从未发现节点n[]中,发现距离源点最短的节点m,求出最短节点后,将m添加到已发现节点y[]中,用该节点m进行更新其它未发现节点n[]-m的最 ...

  6. django的所有app放在一个文件夹下便于管理

    1.新建一个python Package,名字叫apps 2.拖拽以后的app到apps文件夹下,把Search for references勾选去掉,重要重要重要!!!! 3.右键点击apps文件夹 ...

  7. web Servlet 3.0 新特性之web模块化编程,web-fragment.xml编写及打jar包

    web Servlet 3.0 模块化 原本一个web应用的任何配置都需要在web.xml中进行,因此会使得web.xml变得很混乱,而且灵活性差,因此Servlet 3.0可以将每个Servlet. ...

  8. 这样才能使本地Mysql服务允许被外部主机连接(两步)

    网上的N多方法都不全面,只有下面的第一步或第二步是不行的,必须同时执行下面两步操作: 修改mysql.user表 以root或debian-sys-maint身份登录mysql $ mysql -u ...

  9. Pycharm 2018 1.2版本 Mac注册码激活码

    此链接中较为详细的解决了次问题:http://www.orsoon.com/Mac/159477.html

  10. Linux系统——shell脚本

    shell脚本编程 作用:通过命令行解析的方式,自动执行设定好的程序或命令代码.(若将脚本挂到定时任务中,就会自动在非工作时间里自动触发执行程序) Shell脚本文件以“.sh”结尾 规范的Shell ...