Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Servlet life cycle works     - SecureCRT in Python scripting study guide (Programming)

- Install Ubuntu Software Center App Grid (Linux)

- Android View event delivery (Programming)

- Distributed Firewall Design on Linux platform (Linux)

- findmnt- Looking mounted file system (Linux)

- PHP interview questions of design patterns (Programming)

- Appweb configuration in detail (Server)

- Teach you how to ensure password security under the Linux operating system (Linux)

- The Linux disguised as windows to make the system more secure (Linux)

- Getting Started with Linux system to learn: How do I know which processes are running on the CPU core (Linux)

- CentOS6 installed Tomcat (Server)

- Build Docker based MongoDB replication cluster environment (Database)

- Linux, rename the file or folder (mv command and rename command) (Linux)

- The several technical presentation Raid under Linux (Linux)

- Ubuntu 12.04 installed OpenCV 2.3.1, binary image (Linux)

- How to manage the time and date at systemd Linux systems (Linux)

- Dockerfile use to build a mirror-based CentOS 7 (Linux)

- GCC and gfortran write MEX program (Matlab2012a) under Ubuntu 14.04 (Programming)

- Linux operating system set up to effectively prevent ARP attacks (Linux)

- Linux SVN installation and configuration graphic tutorials (Server)

 
         
  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:      
 
- RHEL 5.7 Yum configure local source [Errno 2] No such file or directory (Linux)
- How to use SVN to manage our source code (Server)
- ThinkPad X201i installation notes Debian 7.5 (Linux)
- Linux System Getting Started Learning: Repair fatal error openssl aes h no such file or directory (Linux)
- SVN hook code set to synchronize Web directory (Server)
- Python-- for anomalies and reflection of objects articles (Programming)
- Linux installation and configuration curl command tool (Linux)
- Installation Yarock 1.1.4 Music Player in Ubuntu (Linux)
- The best known for archiving / compression tool under linux (Linux)
- CentOS 6.5 installation Python3.0 (Linux)
- How to manage the time and date at systemd Linux systems (Linux)
- BusyBox making the file system (Linux)
- RHEL / CentOS / Fedora Install Nagios 4.0.1 (Linux)
- Docker build their own private warehouses (Linux)
- Five Linux user space debugging tool (Linux)
- MySQL EXPLAIN SQL output description (Database)
- File encryption and decryption of Linux security mechanisms (Linux)
- C language preprocessor command (Programming)
- Enable Intel Rapid Start in GNU / Linux (Linux)
- Introduction and bash history command to quickly call (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.