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