servlet specification --Servlet actually doing object-oriented specification for HTTP protocol encapsulation

Servlet Specification
A basic Java Web project required jar package only requires a servlet-api.jar, this jar included in the category mostly interfaces, and some tools, there are two packages, respectively, and javax.servlet javax.servlet.http. All Servlet container comes with this package, you do not need to put Web project, put here just need to compile, run is not required. If you simply put the servlet-api.jar webapp / WEB-INF / lib directory, it will report a warning message when Tomcat starts. 
 
Servlet is the most important part of J2EE, J2EE is that you have a Servlet, and other aspects of the selection requires the use of J2EE. The  Servlet specification you need to master is the servlet and filter these two technologies. The vast majority are not based servlet framework is based on the filter, if it is to run on a Servlet container , it will never separate themselves from this model. 
 
Why Servlet specification will be two packages, javax.servlet and javax.servlet.http, the design specification of the earlier people think Servlet model is a service, not necessarily rely on some kind of network protocols, and therefore an abstract javax.servlet, while providing an interface extended on the basis of the HTTP protocol. But from the actual operation for so many years, it seems Servlet technology not found in other agreements. 
 
Servlet specification is actually doing the HTTP protocol object-oriented packages, HTTP request and response protocol that correspond to the two interfaces HttpServletRequest and HttpServletResponse. May be obtained by HttpServletRequest requests all relevant information, including the URI, Cookie, Header, request parameters, etc., no other way. So when you use a framework, you want to get information about HTTP request, as long as you can get HttpServletRequest instances. 
The HttpServletResponse interface is used to produce HTTP response including Cookie, Header and content of the response, and so on.
 
https://www.cnblogs.com/doit8791/p/5280960.html
 
 

Guess you like

Origin www.cnblogs.com/feng9exe/p/11530954.html