Servlet and JSP Overview Servlets are the Java platform technology of choice for extending and enhancing Web servers. Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are server- and platform-independent. This leaves you free to select a "best of breed" strategy for your servers, platforms, and tools.39497
Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection.
Today servlets are a popular choice for building interactive Web applications. Third-party servlet containers are available for Apache Web Server, Microsoft IIS, and others. Servlet containers are usually a component of Web and application servers, such as BEA WebLogic Application Server, IBM WebSphere, Sun Java System Web Server, Sun Java System Application Server, and others.
Java Servlet technology is the answer to the CGI programming. Servlet program running on the server side to dynamically generate Web pages. With traditional CGI and many other similar technical than CGI, Java Servlet more efficient, easier to use and more powerful, more portable, more economical investment.
Efficient
In traditional CGI, each request must start a new process, if the CGI program itself of the execution time is shorter, the overhead required to start the process, but is likely to exceed the actual execution time. In the Servlet, each request by a lightweight Java thread processing rather than heavyweight operating system process.
In traditional CGI, if there are N a concurrent request for the same CGI program, then the CGI program code loaded in memory, repeat N times; while for Servlet, to process the request that the N threads, only a Servlet class code. Performance optimization, Servlet also has more options than the CGI, such cushioning the previous results, the activities to maintain the database connection, and so on.
Convenient
Servlet provides a wealth of practical tools to routines, such as automatically parsing and decoding HTML form data, reading and setting HTTP headers, handling Cookie, tracking session state, etc.
Powerful
In the Servlet, many using traditional CGI programs can be difficult to accomplish the task easily accomplished. For example, Servlet and Web servers can directly interact with the CGI program can not be ordinary. Servlet also be able to share data between various programs, making the database connection pool features like easy to implement.
Portable
Servlet written using Java, Servlet API has perfect standards. Therefore, I-Planet Enterprise Server Servlet written without any substantial modification to migrate to Apache, Microsoft IIS, or WebStar. Almost all mainstream servers are directly or through a plug-in support for Servlet.
JSP and Servlet compared to pure
JSP does not add any nature can not be achieved with Servlet function. However, JSP is more convenient to write static HTML, do not then println statement to output each line of HTML code. More importantly, with the separation of content and appearance of the page making the task of a different nature can be easily separated: for example, the design experts from the HTML page design, while leaving for Servlet programmers to insert dynamic content space.
Compared to JSP and JavaScript
The client side JavaScript to dynamically generate HTML. Although JavaScript is useful, but it can only handle client environment based on dynamic information. In addition to Cookie addition, HTTP status, and JavaScript for form submission data are not available. In addition, because the client is running, JavaScript can not access the server-side resources, such as databases, directory information and so on.
- 上一篇:软件工程技术英文文献和中文翻译
- 下一篇:Struts英文参考文献和中文翻译
-
-
-
-
-
-
-
NFC协议物理层的软件实现+文献综述
上市公司股权结构对经营绩效的影响研究
C++最短路径算法研究和程序设计
现代简约美式风格在室内家装中的运用
江苏省某高中学生体质现状的调查研究
巴金《激流三部曲》高觉新的悲剧命运
g-C3N4光催化剂的制备和光催化性能研究
中国传统元素在游戏角色...
高警觉工作人群的元情绪...
浅析中国古代宗法制度