中英文资料翻译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 systemsDevelopment of a Web repository (database as the core of a variety of Web letterInformation storage) as the core Web applications. Currently, the Web repositorydevelopment technologyOperation 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 popularJava of Ser vet Web repository development 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 clientsNo end, do not download do not by the client security restrictions, the running speedGreatly increasedAndApplet 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 engineAnd expand the capacity of the server. Therefore, we can say Serv the let is run inApplet on a Web server, Serv the let Jav a Ser vlet API And Jav a program of classes and packages.1Servlet access model2Serv the let, there are three access models:(1) an access model1 browser to Web server to issue a retrieval request.2 the Web server after receipt of therequest, the request forwarded to the Servle tengine.3 Serlet engine to perform the requested the Servlet and directly through JDBC4Servlet throughJDBC toretrieve searchresults to generate the html page andPage back to the Web server.5 the Web server the page is sent back to the browser.(2)The second access model1 browser to Web server to issue a retrieval request.2 the Web server receives the request afterthe request forwarded to the of Ser v the letengine.3 Serv let engine to perform the request the the Servlet and retrieve sentJa, vabean access to the data.4data access the Ja vabean searchable database through JDBC informationAnd from the search results stored in itself.5Servlet remove searchresults from the data access Javabean generateHtml 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 model1 A browser issue a retrieval request to the Web server.2 Web server receives the request after the request forwardedto the of Ser v the let engine.Of Ser vlet engine to perform therequested Servlet directly through JDBC inspection3 The cable database and search results are stored in the result is stored the Jav abean into.Javabean,4. Ser v the let from the results arestored to remove the search results andJSP files to format the output page.2 Servlet functionality and life cycle2.1Servlet functions(1) Create and return dynamic Web pages based on customer requests.(2) create can be embedded into existing HTML pages as part of HTML Page (HT fragment) of the ML.(3) and other server resources (including databases and applications based on the Jav aProgram) to communicate.(4) to handle multiple client connections,receiving the input of more than one client, and The results broadcast to multiple clients. For example, Ser vlet is a multi-participantGame server.(5) of MIM E type filter information on the special handling, such as imageConversion and server-side include (SSI).(6) custom processing available to all servers in the standard routine.2.2Servlet lifecycleServlet life cycle 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 loaded2.After the start of the Web server, the client Serv thelet 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 in itialization phase, The number is passed to the Servlet configuration object.(2)terminateWhen the Web server no longer needs the servlet, or reload ServletA new instance of the server calls Serv the let's destroy () method, remove it from the Memory deleted.3 How to call ServletMethod of Ser vlet is called Total five kinds: call in the URL in the form<Form> 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 toThe site 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 <FORM> tagsCall of Ser the let the the <FORM> tag allows users to input 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: <FORM METHOD = "POST / a GET" the ACTION = "/ servletpat h / serv let name"> {place the text inputarea tags, buttons and other logos}(3)in the HTML page to call the servlet.Use <SERVLET> mark <FORM> tags, no need to create a complete HTML page.Instead,the servlet output isonly part of the HTMLpage ( HTML fragment) and dynamicallyembedded into the static text in the original HTML page.All this happened on the server andsent to the user only the resulting HTML page.<SERVLET> </ SERVLET> tag contained in the originalHTML page.Servlet will be invoked in these two markers and the Ser vlet response will cover these two markersbetween all things and mark itself, for example:〈SERVLET NAME= “my serv let ”CODE= “my serv let .class”CODEBASE= “u r l”initpar am= “v alue”〉〈PARAM NAME= “parm1”VALU E= “v alue1”〉〈PARAM NAME= “parm2”VALU E= “v alue2”〉⋯⋯〈/SERVLET 〉(4)call the servlet in the JSP files.Call in the JSP file format used by the Servlet and HTML page to call exactly the same.Andthe principles are identical. Only reconcile its dynamic JSP file is not a static HTML page.(5)in an ASP file calls the servlet.Ifyou Micr oso ft I nt ernet Informatio n-Ser ver (II S) on the legacy of the ASP file, and can not be ASP files transplanted into a JSP file, you can use the ASP file to of Ser vlet iscalled.But it must be through a special ActiveX control, an ASP file is only through it can callthe servlet.4Servlet Howto use ConnectionManager to efficiently manage the databaseconnection(1)the functionality of the Connection Manager.For non-Web applications, Web-based application access to the database will lead tohigher and unpredictable overhead, whichis due to more frequent Web users connect anddisconnect.Normally connected to the resources used and disconnect from the databasewill farexceed the resources used in the retrieval.ConnectionManager function is tominimize the additional occupancy of the usersof the database resources to achieve thebestperformance of database access.Connection Manager sharing overhead through the establishmentof the connection poolwill connect users Servlet available to multiple users request.In other words, each userrequest onlythe connect / disconnect with a smallportion of the overhead costs.Initialresources toestablish the connection of the buffer pool, the rest of th e connect / disconnectoverhead is not big, because this isonly reuse the existing connection.Serv the let in the following manner using the connectionpool: When a user throughRequest Web Serv the let the let Serv use anexisting connection from the buffer poolNext, this means that the user requests do notcause the connection to the databasesystem overhead. InAfter the termination of serv the let it connect toreturn to the pool for its Connection ManagerThe Ser vlet. Thus, the user request does not cause the database is disconnectedOf system overhead.Connection Manager also allows users to be able tocontrol the concurrency of thedatabase products evenThen the number. When the database licenseagreement limit the number of users, this feature isVery useful. Create a buffer pool for the database, and connection managementBuffering pool "maximum number of connections" parameter setto the database product license limitGiven maximum number of users. If you use otherprograms without Connection ManagerconnectionsDatabase, you can not guarantee that the method is effective.(2)the structure of the Connection Manager.(3)Connection Manager connection pool to maintain a connection to aspecific database is open. Step 1: When the first Serv the let trying to Connection Manager communications is loaded by the Java Application Server Connection Manager. As long as the Java application server running the Connection Manager has been loaded. Step 2: The Java application server passes the request to a servlet. Step 3: Servlet Connection Manager requests a connection from the pool. Step four: the buffer pool to Ser vlet allocated a pool of existing idleconnection. Step 5: servlet to use to connect a direct dialogue with the database, this process is the standard API for a particular database. Step 6: the database through Ser vlet the connection returns data. Step 7: When the Servlet end to communicate with the database, servlet connections returned to the connection manager pool for other servlet uses. Step 8: Servlet Jav a application server to the user sends back response.Servlet requests a connection, if the buffer pool, there is no idle connection, then the connection manager directly communicate with the database. Connection Manager will: Step 9: to the database requests a new connection. Step 10: Add connections to the buffer pool. If the buffer pool is connected to the prescribed ceiling, connect to the serverWill not be a new connection to join the buffer pool(3) the performance characteristics of the Connection Manager. Buffer pool to create a new connection is a high overhead tasks, new connections will use the resources on the database. Therefore, the Connection Manager the best use of existing connections of the buffer pool to meet the request of the Servlet. Meanwhile, the connecting tubeThe processor must be as much as possible to minimize the buffer pool idle connections, because this is a great waste of system resources. Connection Manager Serv the let with the implementation of these minimize and maximize task. Connection Manager to maintain each connection verification time stamp, and recently used tags and use the logo. When the a Ser vlet first the connection, connection verification time stamp, and most recent time stamp is set to the current time, the connection is being used flag is set totrue.Connection Manager can be removed from a Serv the let along-unused connections, this length of time specified by the Connection Manager, the longest cycle parameters.Connection Manager can view recently used mark is being used to connect. If the time between the most recently used time and time difference is greater than the longest cycle configuration parameters, the connection will be considered to be a residual connection, which indicates Serv the let take its discontinued or no response. Residual connection will be returned to the pool for other Ser vlet, it is being used flag is set to false, authentication and time stamp is set to the current time. If Ser vlet is ready within a longer period of time to use the connection with the database several timesCommunications, you must code to the Serv the let, so that each time you use to connectConfirm that it still occupies this connection.Connection Manager can be removed from the buffer pool idle connections, because theyWould be a waste of resources. In order to determine which connection is idle, Connection Manager will checkInvestigation connected the sign and time stamp, this operation is connected by periodic access toBuffer pool information. Connection Manager checks have not been any Ser vlet makeWith the connections (these connections is to use the logo isfalse). If you have recently usedBetween time and the current time difference exceeds a maximum idle time configuration parameters, theThat the connection is idle. Idle connection will be removed from the buffer pool, down toMinimum number of connections configuration parameter specifies the lower limit value.翻译:随着Inter net 的普及应用, 各种Web 信息系统的建立已成为一个迫在眉睫的问题。