What is servlets · understand the Servlet API and compare with CGI · Know the use of the main classes in servlet. · Can achieve simple servlets · What is servlet? · Generally, the server-side Java application extends the functionality of the web server. . You can run intact on the server. No need to download to your browser. Instead of CGI script · Servlets advantage over:. Easy and flexibility. Security. Perform efficiency security advantages • Calls in the range of the server • Servlet Call • In the security system, it is possible to become a single (global) signal. The Run In the Same Context AS Application Server · Execute and resides in memory · Mount or put it in advance when there is a request · Extractions over http Request to maintain a dialogue · Reduce the burden of the rear system · Multithreading · IBM WebSphere Performance Pack, the general servlet call · Customer created a web service request, named a servlet, just like Part of the URL · The web server sends a request to the servlet engine to the servlet engine positioned by the object of a servlet class to call a servlet's service method: Browser (Customer) <==== URL request =====> Web server <===> Servlet object (Application Server) Java Servlet Application Interface API · JSDK includes two packages: javax.servlet javax.servlet.http javax.servlet.Servlet | implement javax.servlet.GenericServlet A | javax. Servlet.http.httpservlet a servlet · Performance · Generally passed the URL request · servlets is loaded with the application server · In the initialization phase of the service (if it is pre-installed) · When the client is requested · Re-re-servlet When loading, the lifecycle of servlet is called when the INIT () method is called. Only this time. When each customer issues a request, the service () method is called. When it is uninstalled, the destroy () method is called INIT () | service () | Destroy () HTTP Servlet · A HTTP-SPECIFIC Request Processor • Method for Join Two HTTP-Specific • Doget () - Handling a GET Request (URL) · Dopost () - Process A POST Request (HTML) · Subclass replaces these two information and may replace init () and destroy () · doget () and dopost () Work and be called requests and responses to service (), doget () and dopost () methods have two parameters: • HTTPSERVLETREQUEST - Provide access to request data (parameters) httpsession information.