Jsp/serverlet difference __js

Source: Internet
Author: User

The concept of JSP and servlet is not clear to JSP beginners, the following summarizes some personal views:

(1). In simple terms, JSP is HTML with Java code, and the servlet is Java code containing HTML;

(2). JSP is eventually interpreted as a servlet and compiled and then executed, JSP is just another way to write the servlet;

(3). JSP good at saying that the servlet is good at data processing, in the MVC three-tier structure, JSP is responsible for V (view), servlet responsible for C (control), each has advantages, their respective roles;

Servlet in the implementation of the function is actually the same, can be said with JSP can be implemented, servlet can also be implemented, but from the perspective of application, JSP more suitable for the performance layer of things because he has tag support, and the servlet is suitable to do data logic layer of data processing.

Serverlet is a Java class, and the Web should be Httpserverlet, which extends from Genericserverlet (an abstract class that partially implements the Serverlet interface). The greatest benefit of the Serverlet class is the ability to provide Request/response server functionality, which executes its own service (Request,response) method when a request is submitted to Serverlet.

is to show that no logical judgment function can handle the data?

In the client, use Javascript to solve

But how to solve the server can use Java code to do the control this servlet is an interface between the client and the server to connect all functions

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.