1、 中英文资料翻译 With the popularity of the Inter NET applications, a variety of Web Information System Has become a pressing issue. Establish the essence of Web information systems Development of a Web repository (database as the core of a variety of Web letter Information storage) as the core
2、 Web applications. Currently, the Web repositorydevelopment technology Operation of a wide range of different characteristics. Various periods at all levels, a variety of purposes Technology co-exist, dizzying mirror chaos, it is difficult to choose. More popular Java of Ser vet Web repository de
3、velopment program a more practical Of choice. Servlet is running the applet on the Web server, can be completed Xu Multi-client Applet can not complete the work, which runs on the server and clients No end, do not download do not by the client security restrictions, the running speed Greatly in
4、creased And Applet running in a browser and extend the browser's ability similar Like, Serv the let run in the Web server to enable Java Serv the let engine And expand the capacity of the server. Therefore, we can say Serv the let is run in Applet on a Web server, Serv the let Jav a Ser vlet API
5、 And Jav a program of classes and packages. 1 Servlet access model 2 Serv the let, there are three access models: (1) an access model 1 browser to Web server to issue a retrieval request. 2 the Web server after receipt of the request, the request forwarded to the Servle tengine. 3 Serlet en
6、gine to perform the requested the Ser vlet and directly through JDBC 4Servlet throughJDBC toretrieve search results to generate the html page and Page back to the Web server. 5 the Web server the page is sent back to the browser. (2)The second access model 1 browser to Web server to issue
7、 a retrieval request. 2 the Web server receives the request after the request forwarded to the of Ser v the letengine. 3 Serv let engine to perform the request the the Ser vlet and retrieve sent Ja, vabean access to the data. 4data access the Ja vabean searchable database through JDBC informatio
8、n And from the search results stored in itself. 5Servlet remove search results from the data access Javabean generate Html page and Ht ml of page back to the w eb server. 6 the Web server the page is sent back to the browser. (3) The third access model 1 A browser issue a retrieval request t
9、o the Web server. 2 Web server receives the request after the request forwarded to the of Ser v the let engine. Of Ser vlet engine to perform the requested Servlet directly through JDBC inspection 3 The cable database and search results are stored in the result is stored the Jav abean into.Javab
10、ean, 4. Ser v the let from the results are stored to remove the search results and JSP files to format the output page. 2 Servlet functionality and life cycle 2.1 Servlet functions (1) Create and return dynamic Web pages based on customer requests. (2) create can be embedded into existing HTM
11、L pages as part of HTML Page (HT fragment) of the ML. (3) and other server resources (including databases and applications based on the Jav a Program) to communicate. (4) to handle multiple client connections, receiving the input of more than one client, and The results broadcast to multiple cl
12、ients. For example, Ser vlet is a multi-participant Game server. (5) of MIM E type filter information on the special handling, such as image Conversion and server-side include (SSI). (6) custom processing available to all servers in the standard routine. 2.2Servlet lifecycle Servlet life cycle
13、 begins with it into the Web server's memory And end in the termination or re-loaded Serv the let. (1) load. Load the servlet at the following times: 1. If you have configured automatic load option, and then start the Web server automatically loaded 2. After the start of the Web server, the cli
14、ent Serv the let issued for the first time, please Demand. 3. Reload Serv the let. Loaded Servlet, Web servers to create a servlet instance, and Servlet's init () method is called. Servlet initialization parameters in the initialization phase, The number is passed to the Servlet configuration o
15、bject.
(2) terminate
When the Web server no longer needs the servlet, or reload Servlet
A new instance of the server calls Serv the let's destroy () method, remove it from the
Memory deleted.
3 How to call Servlet
Method of Ser vlet is called Total five kinds: call in the URL in the form
16、m> Tag call, call, in HT the ML page in the JSP files
Call, call in an ASP file. The following itemized to be introduced.
(1) call the servlet in the URL.
Simply input format in the browser as http: ∥ yo ur webser ver
the same the ser vlet name name / servlet path / servlet the URL to
The site 17、canbe. Ofwhich:your webser ver name is to refer to the Servlet where theWeb server name, the servlet path is the path refers to the Servlet, the servletThe name refers to the Servlet real name or an alias.
(2) call the Servlet
18、t data on the Web page, andinput data submitted to the vlet of Ser.Serv the let will be submitted to receive data in different ways.For example:






