文档详情

外文文献—Servlets和JSP Pages最佳实践.doc

发布:2017-09-16约2.39万字共12页下载文档
文本预览下载声明
附录I 英文资料翻译 Servlets and JSP Pages Best Practices by Qusay H. Mahmoud March 2003 Java Servlet technology and JavaServer Pages (JSP pages) are server-side technologies that have dominated the server-side Java technology market; theyve become the standard way to develop commercial web applications. Java developers love these technologies for myriad reasons, including: the technologies are fairly easy to learn, and they bring the Write Once, Run Anywhere paradigm to web applications. More importantly, if used effectively by following best practices, servlets and JSP pages help separate presentation from content. Best practices are proven approaches for developing quality, reusable, and easily maintainable servlet- and JSP-based web applications. For instance, embedded Java code (scriptlets) in sections of HTML documents can result in complex applications that are not efficient, and difficult to reuse, enhance, and maintain. Best practices can change all that. In this article, Ill present important best practices for servlets and JSP pages; I assume that you have basic working knowledge of both technologies. This article: Presents an overview of Java servlets and JavaServer pages (JSP pages) Provides hints, tips, and guidelines for working with servlets and JSP pages Provides best practices for servlets and JSP pages Overview of Servlets and JSP Pages Similar to Common Gateway Interface (CGI) scripts, servlets support a request and response programming model. When a client sends a request to the server, the server sends the request to the servlet. The servlet then constructs a response that the server sends back to the client. Unlike CGI scripts, however, servlets run within the same process as the HTTP server. When a client request is made, the service method is called and passed a request and response object. The servlet first determines whether the request is a GET or POST operation. It then calls one of the following methods: doGet or doPost. The doGet method
显示全部
相似文档