Getting Started with servlet development (1) servlet Introduction

Source: Internet
Author: User

Jsp+javabean+servlet but that is MVC, the servlet has been playing a very important role in development, all standard development can not be separated from the servlet, let's see what is the servlet, what is its purpose

Introduction to the Servlet

A servlet (server-side applet) is a server-side program written in the Java language that generates a dynamic Web page, like a JSP, that is primarily run on the server side and executed by a server invocation, a class developed according to the servlet standard.

The servlet program is Java's implementation of the CGI (Public Gateway Interface) program, but unlike traditional CGI processing operations, the servlet uses multithreading, which makes the servlet program more efficient than traditional CGI. And the servlet retains Java portability, making the servlet easier to use and more powerful

The reader of the applet should feel that it is similar to the servlet and is a small application

Before the JSP program, basically or for the servlet service, if the sentence more professional, from the development of JSP, is first produced a servlet, and then generated a JSP, because the servlet development is more difficult, so for Java technology can walk better, Sun Company to Microsoft to learn the characteristics of ASP technology, this has a JSP program, but the JSP program in the implementation of the time is still dependent on. *class file execution, so the JSP is still the essence of the servlet

The basic process of servlet processing

The basic process of servlet processing (pictured below)

1. Clients (most likely web browsers) make requests via HTTP

2. The Web server receives the request and sends it to the servlet. If the servlet has not yet been loaded, the Web server will load it onto the Java virtual machine and execute it.

The 3.Servlet program will accept the HTTP request and perform some sort of processing

4. The servlet returns the processed results to the Web server to answer

5. The Web server sends back replies received from the servlet to the client

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.