Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Servlet life cycle works     - OpenGL Superb Learning Notes - New Patterns (Programming)

- Ubuntu 14.04 compile and install Apache (Server)

- Linux system security reinforcement system by masquerading method (Linux)

- MySQL backup tool to back up mydumper (Database)

- How to upgrade the kernel to 3.13.7 on Ubuntu / Linux Mint (Linux)

- lack of SWAP space during installation of Oracle (Database)

- Linux regex sed detailing (Linux)

- Difference LVS three scheduling modes (Server)

- php security study (Linux)

- Kickstart automated installation and deployment RHEL 7.0 (Linux)

- HAproxy let IP recording back-end RS (Server)

- How to enhance the security of Linux systems (Linux)

- Oracle 11g modify MEMORY_TARGET (Database)

- Install the latest development version of Wine on RedHat and Debian-based systems (Linux)

- Piostat - Monitoring and Statistics Linux process (Linux)

- Oracle 12c of the auto-increment Identity Columns (Database)

- ApacheDS configuration of users and user groups to achieve SSO (Server)

- Linux operating tips: Can not open file for writing or operation not permitted solution (Linux)

- Python2 ---- function using dictionaries (Programming)

- Implement binary search algorithm in C language (Programming)

 
         
  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.
     
         
         
         
  More:      
 
- Unity Greeter Badges: the lost session icon back to the login screen Ubuntu (Linux)
- Cobbler remotely install CentOS system (Linux)
- 15 things to do after installing Ubuntu 15.04 Desktop (Linux)
- CentOS 7 RHEL 7 to reset the root password (Linux)
- Debian (Wheezy) Install Java environment / replace OpenJDK as the SUN JDK (Linux)
- sudo command scenario analysis (Linux)
- MySQL composite partition (Database)
- Python closure and function objects (Programming)
- Ubuntu 15.04 installed JDK and configured as the default JDK (Linux)
- Linux uses the SMTP proxy to send mail (Linux)
- CentOS 6.6 install rsync server (Server)
- Java data structures - the linear form of the single-chain applications (Programming)
- Java Network Programming Internet address lookup (Programming)
- Linux basic introductory tutorial ---- simple text processing (Linux)
- Create the container and run the application Docker (Server)
- Use Bosh deploy CloudFoundry problems encountered on OpenStack (Server)
- Write perfect printf (Programming)
- TeamCity continuous integration in the Linux installation (Linux)
- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)
- Linux System Getting Started Tutorial: Five image processing software (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.