In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about what Java Servlet means. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
What is Servlet?
Java Servlet is a program that runs on a Web server or application server and acts as an intermediary between a request from a Web browser or other HTTP client and a database or application on the HTTP server.
With Servlet, you can collect user input from Web page forms, render records from databases or other sources, and create web pages dynamically.
Java Servlet can usually achieve the same effect as a program implemented using CGI (Common Gateway Interface, Common Gateway Interface). But compared with CGI,Servlet, it has the following advantages:
The performance is obviously better.
Servlet is executed in the address space of the Web server. This eliminates the need to create a separate process to handle each client request.
Servlet are platform independent because they are written in Java.
The Java Security Manager on the server enforces a series of restrictions to protect resources on the server computer. Therefore, Servlet is credible.
The full functionality of the Java class library is available to Servlet. It can interact with applets, database, or other software through sockets and RMI mechanisms.
Servlet architecture
The following figure shows the location of Servlet in the Web application.
Servlet task
Servlet performs the following main tasks:
L reads explicit data sent by the client (browser). This includes HTML forms on a web page, or forms from applet or a custom HTTP client program.
L reads implicit HTTP request data sent by the client (browser). This includes cookies, media types, compressed formats that browsers can understand, and so on.
L processes the data and generates the results. This process may require accessing the database, making RMI or CORBA calls, invoking Web services, or directly calculating the corresponding response.
Send explicit data (that is, documents) to the client (browser). The document can be in a variety of formats, including text files (HTML or XML), binaries (GIF images), Excel, and so on.
Send an implicit HTTP response to the client (browser). This includes telling browsers or other clients what type of document is returned (such as HTML), setting cookies and cache parameters, and other similar tasks.
Servlet package
Java Servlet is a Java class that runs on a web server with an interpreter that supports the Java Servlet specification.
Servlet, which can be created using javax.servlet and the javax.servlet.http package, is a standard part of Java Enterprise Edition, an extended version of the Java class library that supports large development projects.
These classes implement the Java Servlet and JSP specifications. At the time of writing this tutorial, the corresponding versions are Java Servlet 2.5 and JSP 2.1.
Java Servlet, like any other Java class, has been created and compiled. After you install the Servlet packages and add them to the Classpath classpath on your computer, you can compile Servlet through JDK's Java compiler or any other compiler.
Thank you for reading! This is the end of this article on "what does Java Servlet mean?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.