Servlet Notes 04:servlet life cycle

Source: Internet
Author: User

1. When the servlet is called for the first time, it triggers the init function, which loads the servlet into memory. The INIT function will only be called once

2. Call the service function

3. The service function is called directly by any request that calls the servlet thereafter

4. When this web app reload or shuts down, the Destory function is called to destroy the servlet

On a Web server, when a servlet application is first accessed and the Init function is called, the servlet persists in memory and serves all users.

This means that all users use the same servlet.

The servlet is singleton and the thread is unsafe.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.