为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > 计算机毕设资料jsp技术网站设计外文翻译

计算机毕设资料jsp技术网站设计外文翻译

2018-09-09 7页 doc 61KB 89阅读

用户头像

is_840626

暂无简介

举报
计算机毕设资料jsp技术网站设计外文翻译沈阳航空航天大学北方科技学院毕业设计(论文)外文翻译——原文 JSP and Servlet The technology of JSP and Servlet is the most important technology which use Java technology to exploit request of server, and it is also the standard which exploit business application .Java developers prefer to use ...
计算机毕设资料jsp技术网站设计外文翻译
沈阳航空航天大学北方科技学院毕业(论文)外文翻译——原文 JSP and Servlet The technology of JSP and Servlet is the most important technology which use Java technology to exploit request of server, and it is also the standard which exploit business application .Java developers prefer to use it for a variety of reasons, one of which is already familiar with the Java language for the development of this technology are easy to learn Java to the other is "a preparation, run everywhere" to bring the concept of Web applications, To achieve a "one-prepared everywhere realized." And more importantly, if followed some of the principles of good design, it can be said of separating and content to create high-quality, reusable, easy to maintain and modify the application. For example, if the document in HTML embedded Java code too much (script), will lead the developed application is extremely complex, difficult to read, it is not easy reuse, but also for future maintenance and modification will also cause difficulties. In fact, CSDN the JSP / Servlet forum, can often see some questions, the code is very long, can logic is not very clear, a large number of HTML and Java code mixed together. This is the random development of the defects. Similar to CGI, Servlet support request / response model. When a customer submit a request to the server, the server presented the request Servlet, Servlet responsible for handling requests and generate a response, and then gave the server, and then from the server sent to the customer. And the CGI is different, Servlet not generate a new process, but with HTTP Server at the same process. It threads through the use of technology, reduce the server costs. Servlet handling of the request process is this: When received from the client's request, calling service methods, the method of Servlet arrival of the first judgement is what type of request (GET / POST / HEAD…), then calls the appropriate treatment (DoGet / doPost / doHead…) and generate a response. Although such a complex, in fact, simply said to Servlet is a Java class. And the general category of the difference is that this type operating in a Servlet container, which can provide session management and targeted life-cycle management. So that when you use the Servlet, you can get all the benefits of the Java platform, including the safety of the management, use JDBC access the database and cross-platform capability. Moreover, Servlet using thread, and can develop more efficient Web applications. JSP technology is a key J2EE technology, it at a higher level of abstraction of a Servlet. It allows conventional static and dynamic HTML content generated by combining an HTML page looks like, but as a Servlet to run. There are many commercial application server support JSP technology, such as BEA WebLogic, IBM WebSphere, JRun, and so on. JSP and Servlet use more than simple. If you have a JSP support for Web servers, and a JSP document, you can put it Fangdao any static HTML files can be placed, do not have to compile, do not have to pack, do not have to ClassPath settings, you can visit as ordinary Web It did visit, the server will automatically help you to do other work. After another visit this page to the customer, as long as the paper there have been no changes, JSP engine has been loaded directly call the Servlet. If you have already been modified, it will be once again the implementation of the above process, translate, compile and load. In fact, this is the so-called "first person to punishment." Because when the first visit to the implementation of a series of the above process, so will spend some time after such a visit would not. Java servlets offer a powerful API that provides access to all the information about the request, the session, and the application. combining JSP with servlets lets you clearly separate the application logic from the presentation of the application; in other words, it lets you use the most appropriate component type for the roles of Model, View and Controller. Servlet Lifecycle The web container manages all aspects of the servlet's lifecycle. It creates an instance of the servlet class when needed, passes requests to the instance for processing, and eventually removes the instance. For an HttpServlet, the container calls the following methods at the appropriate times in the servlet lifecycle. Besides the doGet( ) and doPost( ) methods, there are methods corresponding to the other HTTP methods: doDelete( ), doHead( ), doOptions( ), doPut( ), and doTrace( ). Typically you don't implement these methods; the HttpServlet class already takes care of HEAD, OPTIONS, and TRACE requests in a way that's suitable for most servlets, and the DELETE and PUT HTTP methods are rarely used in a web application. It's important to realize that the container creates only one instance of each servlet. This means that the servlet must be thread safe -- able to handle multiple requests at the same time, each executing as a separate thread through the servlet code. Without getting lost in details, you satisfy this requirement with regards to instance variables if you modify the referenced objects only in the init( ) and destroy( ) methods, and just read them in the request processing methods. . Reading a Request One of the arguments passed to the doGet( ) and doPost( ) methods is an object that implements the HttpServletRequest interface. This interface defines methods that provide access to a wealth of information about the request. JSP和Servlet Servlet和JSP技术是用Java开发服务器端应用的主要技术,是开发商务应用示端的标准。Java开发者喜欢使用它有多种原因,其一是对于已经熟悉Java语言的开发者来说这个技术容易学习;其二是Java把“一次编写,到处运行”的理念带入到Web应用中,实现了“一次编写,到处实现”。而且更为重要的是,如果遵循一些良好的设计原则的话,就可以把表示和内容相分离,创造出高质量的、可以复用的、易于维护和修改的应用程序。比方说,在HTML文档中如果嵌入过多的Java代码(scriptlet),就会导致开发出来的应用非常复杂、难以阅读、不容易复用,而且对以后的维护和修改也会造成困难。事实上,在CSDN的JSP/Servlet论坛中,经常可以看到一些提问,代码很长,可以逻辑却不是很清晰,大量的HTML和Java代码混杂在一起,让人看得一头雾水。这就是随意开发的弊端。 与CGI相似,Servlet支持请求/响应模型。当一个客户向服务器递交一个请求时,服务器把请求送给Servlet,Servlet负责处理请求并生成响应,然后送给服务器,再由服务器发送给客户。与CGI不同的是,Servlet没有生成新的进程,而是与HTTP Server处于同一进程中。它通过使用线程技术,减小了服务器的开销。Servlet处理请求的过程是这样的:当收到来自客户端的请求后,调用service方法,该方法中Servlet先判断到来的请求是什么类型的(GET/POST/HEAD…),然后调用相应的处理方法(doGet/doPost/doHead…)并生成响应。 别看这么复杂,其实简单说来Servlet就是一个Java类。与一般类的不同之处是,这个类运行在一个Servlet容器内,可以提供session管理和对象生命周期管理。因而当你使用Servlet的时候,你可以得到Java平台的所有好处,包括安全性管理、使用JDBC访问数据库以及跨平台的能力。而且,Servlet使用线程,因而可以开发出效率更高的Web应用。 JSP技术是J2EE的一个关键技术,它在更高一级的层次上抽象Servlet。它可以让常规静态HTML与动态产生的内容相结合,看起来像一个HTML网页,却作为Servlet来运行。现在有许多商业应用服务器支持JSP技术,比如BEA WebLogic、IBM WebSphere、 JRun等等。使用JSP比用Servlet更简单。如果你有一个支持JSP的Web服务器,并且有一个JSP文件,你可以把它放倒任何静态HTML文件可以放置的位置,不用编译,不用打包,也不用进行ClassPath的设置,就可以像访问普通网页那样访问它,服务器会自动帮你做好其他的工作。 以后再有客户访问这个页面的时候,只要该文件没有发生过更改,JSP引擎就直接调用已经装载的Servlet。如果已经做过修改的话,那就会再次执行以上过程,翻译、编译并装载。其实这就是所谓的“第一人惩罚”。因为首次访问的时候要执行一系列以上的过程,所以会耗费一些时间;以后的访问就不会这样了。 Java servlet提供了一种强有力的API,用这个API可以访问关于请求、会话和应用程序的所有信息。将servlet和JSP页面组合起来使用,可以把应用程序的逻辑部分和外观呈现部分清楚地分开;换句话,利用这个方式可以对模型、视图和控制器这三种角色分别使用最合适的组件类型。 Servlet的生命周期 Web容器管理servlet生命周期的所有方面。它根据需要创建servlet类的实例、将请求传递给实例进行处理,最终删除实例。对于HttpServlet来说,容器会在servlet生命周期的适当时间调用方法。 除了doGet()和doPost()方法之外,还有一些对应于其他HTTP方法的方法:doDelete()、doHead()、doOptiongs()、doPut()和doTrace()。一般情况下不用实现这些方法,因为HttpServlet类已经用适用于大多数servlet的方法考虑到了HEAD、OPTIONS和TRACE请求,而且DELETE和PUT这两种HTTP方法很少用在Web应用程序中。 容器只为每个Servlet创建一个实例非常重要。这意味着servlet必须是线程安全的—即,能够同时处理多个请求,每个处理都通过servlet代码作为单独的线程来执行。如果只在init()和destroy()方法中修改参考的对象,而且只在请求处理方法中读取他们,那么不用丧失任何细节就可以满足关于实例变量的这个要求。 读取请求 传递到doGet()和doPost()方法的参数之一是实现了HttpServletRequest接口的对象。该接口定义的方法可提供对关于请求的许多信息的访问。 [1] Clifton G.M. Branham, Arthur Jonathan .Servlets and JSP in an undergraduate database course[J].Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications,2003(3):1490-1496. [2] Kirkegaard, Christian.Static analysis for Java servlets and JSP[J].Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics),2006(4):336-352. [3] Nakaike,Takuya.JSP Splitting for improving execution performance[J].Proceedings International Symposium on Applications and the Internet,2004[8]:117-126. [4] Hassan, Doaa .Developing a security typed java servlet[J].Proceedings - The 4th International Symposium on Information Assurance and Security,2008(10):215-220. [5] Juan Lipson Vuong.A semantics-based routing scheme for grid resource discovery[M].E-Science: First International Conference on E-Science and GridComputing,2005:58-70,90. [6] Watts D J.Small Worlds. The dynamics of networks between order and randomness[P].America: 56A2579BB6,l999-05-13. 4
/
本文档为【计算机毕设资料jsp技术网站设计外文翻译】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索