【正文】
Servlets suffer from neither of these problems. Even if a servlet executes a system call (., with or JNI) to invoke a program on the local operating system, it does not use a shell to do so. And, of course, array bounds checking and other memory protection features are a central part of the Java programming language. 7. Mainstream There are a lot of good technologies out there. But if vendors don39。 see so industry support for servlets is being even more pervasive. B/S ( Browser/Server ) structure browser and server structure. It is along with the technology of Inter spring up , it is for the structure of improvement or a kind of change of the structure of C/S. Under this kind of structure, user working interface is to realize through WWW browser, lose the logic of general affairs very much in front( Browser) realization, but the major logic of general affairs in server end( Server) realization, form the threelayer claimed 3tier structure. So, have simplified customer end puter load greatly , have alleviated system to defend workload and the cost with upgrading , have reduced the overall cost of user ( TCO ). With present technology see , local area work the work application that establishes the structure of B/S , and under the pattern of Inter/Intra, database application is easy to hold relatively , cost also is lower. It is that oneness goes to the development of position , can realize different people, never same place, with difference receive the way of entering ( for example LAN, WAN, Inter/Intra etc.) visit and operate mon database。ll only be discussing HTTP servlets. The Advantages of Servlets Over Traditional CGI Java servlets are more efficient, easier to use, more powerful, more portable, safer, and cheaper than traditional CGI and many alternative CGIlike technologies. 1. Efficient With traditional CGI, a new process is started for each HTTP request. If the CGI program itself is relatively short, the overhead of starting the process can dominate the execution time. With servlets, the Java virtual machine stays running and handles each request with a lightweight Java thread, not a heavyweight operating system process. Similarly, in traditional CGI, if there are N requests to the same CGI program, the code for the CGI program is loaded into memory N times. With servlets, however, there would be N threads, but only a single copy of the servlet class would be loaded. This approach reduces server memory requirements and saves time by instantiating fewer objects. Finally, when a CGI program finishes handling a request, the program terminates. This approach makes it difficult to cache putations, keep database connections open, and perform other optimizations that rely on persistent data. Servlets, however, remain in memory even after they plete a response, so it is straightforward to store arbitrarily plex data between client requests. 2. Convenient Servlets have an extensive infrastructure for automatically parsing and decoding HTML form data, reading and setting HTTP headers, handling cookies, tracking sessions, and many other such highlevel utilities. In CGI, you have to do much of this yourself. Besides, if you already know the Java programming language, why learn Perl too? You39。t know what to display until you read the data that the user submits. Just remember that the user submits two kinds of data: explicit (., HTML form data) and implicit (., HTTP request headers). Either kind of input can be used to build the output page. In particular, it is quite mon to build a userspecific page based on a cookie value. 2. The Web page is derived from data that changes frequently. If the page changes for every request, then you certainly need to build the response at request time. If it changes only periodically, however, you could do it two ways: you could periodically build a new Web page on the server (independently of client requests), or you could wait and only build the page when the user requests it. The right approach depends on the situation, but sometimes it is more convenient to do the latter: wait for the user request. For example, a weather report or news headlines site might build the pages dynamically, perhaps returning a previously built page if that page is still up to date. 3. The Web page uses information from corporate databases or other serverside sources. If the information is in a database, you need serverside processing even if the client is using dynamic Web content such as an applet. Imagine using an applet by itself for a search engine site: Downloading 50 terabyte applet, please wait! Obviously, that is silly。t speak HTTP or return results in HTML, so the Web browser can39。鄭州輕工業(yè)學(xué)院 本科畢業(yè)設(shè)計(jì)(論文) ————— 英文 翻譯 題 目 Servlet 和 Jsp 技術(shù)概要 學(xué)生姓名 婁文 專業(yè)班級(jí) 軟件工程 081 學(xué) 號(hào) 520813130116 院 (系) 軟件 學(xué)院 指導(dǎo)教師 聶南 ( 副 教授) 完成時(shí)間 2020 年 6 月 2 日 Servlet 和 Jsp 技術(shù)概要 軟件工程 081 婁文 520813130116 2 An Overview of Servlet and JSP Technology Abstract: Servlet program running in the serverside, dynamically generated Web page with the traditional CGI and many other similar pared to CGI technology, Java Ser