JSP Summary two: Servlet

Source: Internet
Author: User

A servlet is a piece of Java code that can extend the functionality of a Web server. Each servlet runs in a process, and a new request to the servlet runs as a thread in the servlet process.
The servlet container is responsible for connecting the Web server and the servlet process. The servlet is responsible for providing the servlet's run-time environment and loading and invoking these servlet at the appropriate time. The servlet container can be run in the same process as the Web server, or it can run separately in a process. Even the servlet container itself is a Web server, like Tomcat.
The servlet container passes the user's request to the servlet, and then converts the servlet's response to the HTTP reply message back to the customer.
each servlet process has a servlet context. This servlet context corresponds to a Web application. The Servlet context associates a URL path prefix.
Typically, the servlet receives a request from the client delivered by the servlet container, processes some business logic, and then writes the HTML code into the response stream. But this approach makes the business logic and the Web UI mix, difficult to maintain, and make it impossible for programmers and web designers to work separately.

Related Article

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.