Chinaunix首页 | 论坛 | 博客
  • 博客访问: 634310
  • 博文数量: 17
  • 博客积分: 248
  • 博客等级: 二等列兵
  • 技术积分: 237
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-26 12:13
个人简介

别让往昔的悲伤和对未来的恐惧,毁了你当下的幸福。

文章分类

全部博文(17)

文章存档

2013年(6)

2012年(2)

2011年(9)

我的朋友

分类: Java

2013-03-25 16:15:45



从上图可以清楚的体现了servlet的生命周期,处理过程说明:
    1. A client browser requests a resource on the web server.

    2. The web server checks the request. If it is for a static resource, the web server
        locates the static resource and transmits it to the client. Skip to step 6.
        
        The Tomcat container, when deployed in standalone mode,
        can play the roles of both the web server and a servlet
        container and can serve up both static and dynamic resources.

    3. If it is for a dynamic resource that is being served up by a servlet container,
        the web server delegates to the servlet container instead, which must locate
        the servlet that will process this request. It uses the request URI as well as the
        mappings declared in the deployment descriptor to locate the appropriate
        servlet. If the servlet is already loaded and initialized, then skip to step 4.
        Otherwise, the appropriate servlet class is located, loaded, and
        instantiated. The servlet's init() method is then called, to give it a
        chance to initialize itself.

    4. It then invokes the service() method of the servlet to generate the
        appropriate response.

    5. The response is generated.

    6. The web server returns the completed response to the client browser.

    7. The client browser renders the rendered response.

阅读(659) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~