One of JSP and Servlet

Source: Internet
Author: User

What is the difference between JSP and SERVLET in the application? Many people are confused. Let me say a few things. Simply put, SUN first developed the SERVLET, which has powerful functions and advanced system design. However, it still uses the old CGI method to output HTML statements, therefore, it is inconvenient to write and modify HTML. Later, SUN introduced an embedded JSP similar to ASP and embedded the jsp tag into an HTML statement. This greatly simplifies and facilitates the design and modification of webpages. New Network languages such as ASP, PHP, and JSP are embedded SCRIPT languages.

From the perspective of a three-tier network structure, a network project can be divided into at least three layers: data layer, business layer, and presentation layer. Of course, it can be more complicated. SERVLET is powerful for writing business layers, but it is inconvenient for writing presentation layers. JSP is designed to facilitate the writing of the presentation layer. Of course, you can also write a business layer. Friends who are familiar with ASP, PHP, and CGI often unconsciously mix the presentation layer and business layer. Just like the previous friend who put the database processing information in JSP, in fact, it should be placed in the business layer.

According to SUN's recommendation, JSP should only store the content related to the presentation layer, that is, only the part of the HTML webpage is output. All data computing, data analysis, and database connection processes belong to the business layer and should be placed in java beans. Java beans are called through JSP to achieve integration of two layers.

In fact, Microsoft recently launched the DNA technology, simply put, ASP + COM/DCOM technology. Similar to JSP + BEANS, all presentation layers are completed by ASP, and all business layers are completed by COM/DCOM. Integration is achieved through calling.

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.