Home > Java > javaTutorial > body text

What is servlet

清浅
Release: 2020-09-10 14:47:54
Original
29998 people have browsed it

Servlet is a server-side program written in Java language. It can generate dynamic web pages. It mainly runs on the server side and is executed and called by the server. In addition, it also has powerful transaction processing capabilities.

What is servlet

Servlet is a server-side program written in Java language. It can generate dynamic web pages. It mainly runs on the server side and is executed and called by the server. In addition, it also has powerful transaction processing capabilities

Servlet is a technology provided by sun company for developing dynamic web resources. Next, I will introduce this technology in detail in the article, which has certain reference Value, I hope it will be helpful to everyone

What is servlet

[Recommended tutorial: servlet tutorial]

What is servlet

Servlet is a server-side program written in Java language. It can generate dynamic WEB web pages like JSP. Servlet mainly runs on the server side and is called by the server. A class developed according to Servlet standards. According to the request submitted by the user, the servlet program returns the results or related information to the client browser after running on the application server. And it has powerful transaction processing capabilities.

In reality, servlets can respond to any type of request, but in most cases Servlets are only used to extend web servers based on the THHP protocol

What is servlet

Servlet workflow

The servlet is used to receive the request sent by the browser to the server and send the server's response to the request back to the browser. This process

is transmitted through the HTTP protocol.

(1) First, the browser assembles the relevant information into the requested HTTP message according to the specifications of the HTTP message, and sends it to the designated server through the network.

(2) Secondly, after the server receives the HTTP message sent by the browser, it uses web containers such as Tomcat, jetty, and Jboss to extract and parse the HTTP message. If it is found to be a request, The web container will store the parsing result of this message as a request object, which looks like "the request sent by the browser to the server".

(3) Then, after the server-side program processes the request, it places the processing result in the response object, and encapsulates it into an HTTP protocol message according to the specifications of the HTTP protocol and sends it back to the browser.

(4) Finally, after the browser receives the HTTP message containing the response information, it parses the message and displays the processing results on the browser.

What is servlet

Summary: The above is the entire content of this article, I hope it will be helpful to everyone.

The above is the detailed content of What is servlet. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!