Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Servlet life cycle works     - Replace font under Linux (Linux)

- Redis configuration file interpretation (Database)

- Oracle users to automatically increase the partition table (Database)

- Linux kernel RCU (Read Copy Update) lock Brief - prequel (Linux)

- C ++ 11 feature: decltype keywords (Programming)

- How to create a bootable USB disk to use MultiSystem on Ubuntu (Linux)

- To explore the caching mechanism for Android ListView (Programming)

- Linux Getting Started tutorial: How to backup Linux systems (Linux)

- Oracle Linux 5.9 configuration Xmanager (Linux)

- and localhost difference (Server)

- Linux cron job (crontab) Examples (Linux)

- Command line tool Tmux (Linux)

- Comparison of C # and Java (Programming)

- sa weak passwords intrusion prevention (Linux)

- Programmers Do not neglect debugging techniques (Programming)

- CentOS install video converter FFmpeg and cutting tools segmenter (Linux)

- MySQL to manage multiple instances of method (Database)

- CentOS system Amoeba + MySQL Master-slave configuration (Database)

- The Zabbix2.4.5 source compiler installation under Ubuntu 14.04 (Server)

- Create, modify, delete users, user groups under linux (Linux)

  Servlet life cycle works
  Add Date : 2018-11-21      
  1, Servlet life cycle:

    Servlet loading, loading, service and destroyed.

2, the typical function explanation:

    Init (): This function is used to initialize the Servlet object. In the Servlet life cycle Servlet function is performed only once.

    Destroy (): This function is used to destroy the Servlet object Similarly, Servlet life cycle Servlet function is performed only once.

    Service (): This function is to respond to customer requests Servlet objects when in use. Is the core function of the Servlet. There are two parameters: HTTPRequest, HTTPResponse. HTTPServlet already has Service method, the default service function is to call and request a consistent approach do function.

3, tomcat and Servlet is how it works:

Web client makes a request to the Servlet container (tomcat)
Tomcat receives a request
Servlet container creates a HTTPRequest object into the Web client to request information.
Servlet container create a HTTPResponse object.
Servlet container calls HTTPServlet Service object method, HTTPRequest and HTTPResponse go into the Service function.
HTTPServlet call the relevant method in the request for information HTTPRequest.
HTTPServlet call the relevant methods to generate HTTPResponse.
Servlet returns the results to the corresponding Web client.
4, Servlet works:

    The client sends a request and Servlet container creates based on the request of ServletRequest and ServletResponse, then call the Servlet Service method to obtain the requested information, processes it, and returns a response.

    The method in which the Service Selection and do request method corresponding features, such as doGet, doPost methods. In the Servlet and GenericServlet these methods is no need to define themselves. Although these methods HTTPServlet, but returned Error message, we need to reload themselves.

    Servlet and GenericServlet is not based on any agreement, and HTTPServlet is based on HTTP protocol.
- After you change the GRUB boot disk partition repair (Linux)
- Understanding Java classes (Programming)
- Tip: Use Cryptsetup U disk encryption (Linux)
- Linux installed and tested the deployment of Kafka distributed cluster (Server)
- MySQL replication master and slave structure built (Database)
- Java implementation file encryption and decryption (Programming)
- Postmodern systems programming language (Programming)
- Hibernate4 The Hello World (basic environmental structures) (Programming)
- Ubuntu installation under Scrapy (Linux)
- Use PDFBox processing PDF documents (Linux)
- Debian installation (Linux)
- Daemon under Linux (Linux)
- Python2 ---- function using dictionaries (Programming)
- The signature can not be verified under Debian (Linux)
- Comparison of one-time transaction and CTE insert data (Database)
- About Samba certification process and permissions (Linux)
- Spring REST Exception Handling (Programming)
- The Samba service does not have permission to access (Server)
- Linux ldconfig command (Linux)
- Modern Objective-C syntax and new features (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.