shortcomings, it is gradually being replaced by the trend. Of all the new technology, JSP /
Servlet with more efficient and easy to program, more powerful, more secure and has a
good portability, they have been many people believe that the future is the most dynamic
site of the future development of technology。
Similar to CGI, Servlet support request / response model. When a customer submit a
request to the server, the server presented the request Servlet, Servlet responsible for
handling requests and generate a response, and then gave the server , and then from the
server sent to the customer。 And the CGI is different, Servlet not generate a new process,
but with HTTP Server at the same process. It threads through the use of technology,
reduce the server costs. Servlet handling of the request process is this : When received
from the client’s request,calling service methods, the method of Servlet arrival of the first
judgement is what type of request (GET / POST / HEAD…), then calls the appropriate
treatment (DoGet / doPost / doHead…) and generate a response。
Although such a complex , in fact, simply said to Servlet is a Java class. And the
general category of the difference is that this type operating in a Servlet container, which
can provide session management and targeted life —cycle management. So that when you
use the Servlet, you can get all the benefits of the Java platform, including the safety of
the management, use JDBC access the database and cross-platform capability。 Moreover,
Servlet using thread, and can develop more efficient Web applications.
JSP technology is a key J2EE technology, it at a higher level of abstraction of a Servlet.
4
评论0