外文文献及翻译----Servlet和JSP技术简述

合集下载

servlet概述

servlet概述

servlet概述1 什么是servlet? Servlet 是基于 Java 技术的 web 组件,容器托管的,⽤于⽣成动态内容。

像其他基于 Java 的组件技术⼀样,Servlet 也是基于平台⽆关的 Java 类格式,被编译为平台⽆关的字节码,可以被基于 Java 技术的 web server动态加载并运⾏。

Servlet是⼀种容器,有时候也叫做 servlet 引擎,是 web server 为⽀持 servlet 功能扩展的部分。

客户端通过 Servlet 容器实现的请求/应答模型与 Servlet 交互。

2 什么是servlet容器? Servlet 容器是 web server 或 application server 的⼀部分,提供基于请求/响应发送模型的⽹络服务,解码基于 MIME 的请求,并且格式化基于 MIME 的响应。

Servlet 容器也包含了管理 Servlet ⽣命周期。

Servlet 容器可以嵌⼊到宿主的 web server 中,或者通过 Web Server 的本地扩展 API 单独作为附加组件安装。

Servelt 容器也可能内嵌或安装到包含 web 功能的 application server 中。

所有 Servlet 容器必须⽀持基于 HTTP 协议的请求/响应模型,⽐如像基于 HTTPS(HTTP over SSL)协议的请求/应答模型可以选择性的⽀持。

容器必须实现的 HTTP 协议版本包含 HTTP/1.0 和 HTTP/1.1。

因为容器或许⽀持 RFC2616 (HTTP/1.1)描述的缓存机制,缓存机制可能在将客户端请求交给 Servlet 处理之前修改它们,也可能在将Servlet ⽣成的响应发送给客户端之前修改它们,或者可能根据 RFC2616 规范直接对请求作出响应⽽不交给 Servlet 进⾏处理。

Servlet 容器应该使 Servlet 执⾏在⼀个安全限制的环境中。

JSP技术简介

JSP技术简介

第1章JSP技术简介JSP(Java Server Pages)技术是由Sun公司发布的用于开发动态Web应用的一项技术。

它以其简单易学、跨平台的特性,在众多动态Web应用程序设计语言中异军突起,在短短几年中已经形成了一套完整的规范,并广泛地应用于电子商务等各个领域中。

在国内,JSP 现在也得到了比较广泛的重视,得到了很好的发展,越来越多的动态网站开始采用JSP技术。

本章就对JSP及其相关技术进行简单的介绍。

1.1 认识HTTP协议HTTP协议(Hypertext Transfer Protocol,超文本传送协议)是WWW服务器使用的主要协议,对HTTP协议细节的基本理解是编写JSP或Java小程序的开发人员所必需的。

因此在学习JSP技术之前有必要更加仔细地研究一下HTTP消息的格式(这里的讨论源自HTTP/1.1协议规范。

参见规范2616,网址为/rfc/rfc2616.txt)。

HTTP 协议的关键部分有HTTP请求和HTTP响应,以及客户端Web程序设计的一些基础知识,在第4章4.4节将会具体介绍。

1.2 客户端Web程序设计介绍Web浏览器现已成为深受大多数用户喜爱的用户界面。

HTML语言提供了丰富的控件,第三方厂商提供了Visual Basic编写的数百个额外的控件,这些都使得Web浏览器独具特色。

虽然Web浏览器与传统的GUI界面有一定的差距,但它提供了一种独立而又简单的方法来访问分布式资源,尤其是Internet资源。

而且越来越多的客户端Web程序扩展技术变得更加成熟,出现了包括CSS、JavaScript、VBScript、动态HTML、Java1.1.Applet应用程序等技术在内的客户端Web程序设计技术,它们的相互结合使得Web程序更加迷人。

下面简单介绍几种常用的客户端Web程序设计技术的特点。

本书假定读者对这些技术都有一定的了解,不对这些技术作详细介绍。

1.2.1 CSSCSS(Cascading Style Sheets)称为层叠样式表,是动态HTML技术的一个部分,但可以和HTML结合使用。

外文翻译---将Servlet和JSP组合使用

外文翻译---将Servlet和JSP组合使用

Combining JSP and ServletsThe 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.Early dynamic pages mainly CGI (Common Gateway Interface, public Gateway Interface) technology, you can use different languages of the CGI programs, such as VB, C / C + + or Delphi, and so on. Though the technology of CGI is developed and powerful, because of difficulties in programming, and low efficiency, modify complex shortcomings,it is gradually being replaced by the trend. Of all the new technology, JSP / Servlet with more efficient and easy to program, more powerful, more secure and has a good portability, they have been many people believe that the future is the most dynamic site of the future development of technology.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 / doP ost / 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.JSP document looks like an ordinary static HTML document, but inside contains a number of Java code. It uses. Jsp the suffix, used to tell the server this document in need of special treatment. When we visit a JSP page, the document will first be translated into a JSP engine Java source files, is actually a Servlet, and compiler, and then, like other Servlet, from Servlet engine to handle. Servlet engine of this type loading, handling requests from customers, and the results returned to the customer, as shown below:Figure 1: Calling the process of JSP pagesAfter 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.Servlets, Filters, and ListenersA servlet is a Java class that extends a server with functionality for processing a request and producing a response. It's implemented using the classes and interfaces defined by the Servlet API. The API consists of two packages: the javax.servlet package contains classes and interfaces that are protocol-independent, while the javax.servlet.http package provides HTTP-specific extensions and utility classes.What makes a servlet a servlet is that the class implements an interface named javax.servlet.Servlet, either directly or by extending one of the support classes. This interface defines the methods used by the web container to manage and interact with theservlet. A servlet for processing HTTP requests typically extends the javax.servlet.http.HttpServlet class. This class implements the Servlet interface and provides additional methods suitable for HTTP processing.Servlet LifecycleThe 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.Compiling and Installing a ServletTo compile a servlet, you must first ensure that you have the JAR file containing all Servlet API classes in the CLASSPATH environment variable. The JAR file is distributed with all web containers. Tomcat includes it in a file called servlet.jar, located in the common/lib directory. On a Windows platform, you include the JAR file in the CLASSPATH.. Reading a RequestOne 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.Generating a ResponseBesides the request object, the container passes an object that implements the HttpServletResponse interface as an argument to the doGet( ) and doPost( ) methods. This interface defines methods for getting a writer or stream for the response body. It also defines methods for setting the response status code and headers.Using Filters and ListenersThe servlet specification defines two component types beside servlets: filters and listeners. These two types were introduced in the Servlet 2.3 specification, so if you're using a container that doesn't yet support this version of the specification, I'm afraid you'reout of luck.FiltersA filter is a component that can intercept a request targeted for a servlet, JSP page, or static page, as well as the response before it's sent to the client. This makes it easy to centralize tasks that apply to all requests, such as access control, logging, and charging for the content or the services offered by the application. A filter has full access to the body and headers of the request and response, so it can also perform various transformations. One example is compressing the response body if the Accept-Language request header indicates that the client can handle a compressed response.A filter can be applied to either a specific servlet or to all requests matching a URL pattern, such as URLs starting with the same path elements or having the same extension. ListenersListeners allow your application to react to certain events. Prior to Servlet 2.3, you could handle only session attribute binding events (triggered when an object was added or removed from a session). You could do this by letting the object saved as a sessionattribute(using the HttpSession.setAttribute() method)implement the HttpSessionBindingListener interface. With the new interfaces introduced in the 2.3 version of the specification, you can create listeners for servlet context and session lifecycle events as well as session activation and passivation events (used by a container that temporarily saves session state to disk or migrates a session to another server). A newsession attribute event listener also makes it possible to deal with attribute binding events for all sessions in one place, instead of placing individual listener objects in each session.The new types of listeners follow the standard Java event model. In other words, a listener is a class that implements one or more of the listener interfaces. The interfaces define methods that correspond to events. The listener class is registered with the container when the application starts, and the container then calls the event methods at the appropriate times.Initializing Shared Resources Using a ListenerBeans like this typically need to be initialized before they can be used. For instance, they may need a reference to a database or some other external data source and may create an initial information cache in memory to provide fast access even to the first request for data. You can include code for initialization of the shared resources in the servlet and JSP pages that need them, but a more modular approach is to place all this code in one place and let the other parts of the application work on the assumption that the resources are already initialized and available. An application lifecycle listener is a perfect tool for this type of resource initialization. This type of listener implements the javax.servlet.ServletContextListener interface, with methods called by the container when the application starts and when it shuts down.Picking the Right Component Type for Each TaskThe Project Billboard application introduced is a fairly complex application. Half thepages are pure controller and business logic processing, it accesses a database to authenticate users, and most pages require access control. In real life, it would likely contain even more pages, for instance, pages for access to a shared document archive, time schedules, and a set of pages for administration. As the application evolves, it may become hard to maintain as a pure JSP application. It's easy to forget to include the access control code in new pages.This is clearly an application that can benefit from using a combination of JSP pages and the component types defined by the servlet specification for the MVC roles. Let's look at the main requirements and see how we can map them to appropriate component types:●Database access should be abstracted, to avoid knowledge of a specific dataschema or database engine in more than one part of the application: beans in therole of Model can be used to accomplish this.●The database access beans must be made available to all other parts of theapplication when it starts: an application lifecycle event listener is the perfectcomponent type for this task.●Only authenticated users must be allowed to use the application: a filter canperform access control to satisfy this requirement.●Request processing is best done with Java code: a servlet, acting as the Controller,fits the bill.●It must be easy to change the presentation: this is where JSP shines, acting as theView.Adding servlets, listeners, and filters to the mix minimizes the need for complex logic in the JSP pages. Placing all this code in Java classes instead makes it possible to use a regular Java compiler and debugger to fix potential problems.Centralized Request Processing Using a ServletWith a servlet as the common entry point for all application requests, you gain control over the page flow of the application. The servlet can decide which type of response to generate depending on the outcome of the requested action, such as returning a common error page for all requests that fail, or different responses depending on the type of client making the request. With the help from some utility classes, it can also provide services such as input validation, I18N preparations, and in general, encourage a more streamlined approach to request handling.When you use a servlet as a Controller, you must deal with the following basic requirements:●All requests for processing must be passed to the single Controller servlet.●The servlet must be able to distinguish requests for different types of processing.Here are other features you will want support for, even though they may not be requirements for all applications:● A strategy for extending the application to support new types of processingA mechanism for changing the page flow of the application without modifyingcode.Mapping Application Requests to the ServletThe first requirement for using a Controller servlet is that all requests must pass through it. This can be satisfied in many ways. If you have played around a bit with servlets previously, you're probably used to invoking a servlet with a URI that starts with /myApp/servlet. This is a convention introduced by Suns Java Web Server (JWS), the first product to support servlets before the API was standardized. Most servlet containers support this convention today, even though it's not formally defined in the servlet specification.将Servlet和JSP组合使用Servlet和JSP技术是用Java开发服务器端应用的主要技术,是开发商务应用表示端的标准。

javaweb英文参考文献

javaweb英文参考文献

javaweb英文参考文献以下是关于JavaWeb的英文参考文献的相关参考内容:1. Deepak Vohra. Pro XML Development with Java Technology. Apress, 2006.This book provides a comprehensive guide to XML development with Java technology. It covers topics such as XML basics, XML parsing using Java, XML validation, DOM and SAX APIs, XSLT transformation, XML schema, and SOAP-based web services. The book also includes numerous code examples and case studies to illustrate the concepts.2. Robert J. Brunner. JavaServer Faces: Introduction by Example. Prentice Hall, 2004.This book introduces the JavaServer Faces (JSF) framework, which is a part of the Java EE platform for building web applications. It provides a step-by-step guide to building JSF applications using various components and features such as user interface components, data validation, navigation handling, and backing beans. The book also covers advanced topics such as internationalization and security.3. Brett McLaughlin. Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam. O'Reilly Media, 2008. This book is a comprehensive guide to the development of Java web applications using Servlets and JavaServer Pages (JSP). It covers topics such as HTTP protocol, Servlet lifecycle, request andresponse handling, session management, JSP syntax and directives, JSTL and EL expressions, deployment descriptors, and web application security. The book also includes mock exam questions to help readers prepare for the Sun Certified Web Component Developer exam.4. Hans Bergsten. JavaServer Pages, 3rd Edition. O'Reilly Media, 2011.This book provides an in-depth guide to JavaServer Pages (JSP) technology, which is used for creating dynamic web content. It covers topics such as JSP syntax, scriptlets and expressions, JSP standard actions, JSP custom tag libraries, error handling, JSP with databases, JSP and XML, and internationalization. The book also includes examples and best practices for using JSP effectively.5. Marty Hall, Larry Brown. Core Servlets and JavaServer Pages, 2nd Edition. Prentice Hall, 2003.This book is a comprehensive guide to building Java web applications using Servlets and JavaServer Pages (JSP). It covers topics such as Servlet API, HTTP protocol, session management, request and response handling, JSP syntax and directives, JSP custom tag libraries, database connectivity, and security. The book also includes numerous code examples and case studies to demonstrate the concepts.6. Michael Ernest. Java Web Services in a Nutshell. O'Reilly Media, 2003.This book provides a comprehensive reference to Java-based web services technology. It covers topics such as SOAP, WSDL, UDDI, and XML-RPC protocols, as well as Java API for XML-based web services (JAX-WS) and Java API for RESTful web services (JAX-RS). The book also includes examples and best practices for developing and deploying web services using Java technology. Please note that the above references are just a selection of some of the available books on the topic of JavaWeb. There are numerous other resources available that can provide more detailed information on specific aspects of JavaWeb development.。

servlet技术简介

servlet技术简介

Servlet技术是Sun公司提供的一种实现动态网页的解决方案,它是基于Java编程语言的WEB服务器端编程技术,主要用于在WEB服务器端获得客户端的访问请求信息和动态生成对客户端的响应消息。

Servlet技术也是JSP技术(另外一种动态网页开发技术)的基础。

一个Servlet程序就是一个实现了特殊接口的Java类,用于被支持Servlet的WEB服务器调用和运行,即只能运行于具有Servlet引擎的WEB服务器端。

一个Servlet程序负责处理它所对应的一个或一组URL地址的访问请求,接收访问请求信息和产生响应内容。

Applet是用于浏览器端的Java小程序,在浏览器端被解释执行,用于在HTML网页中实现一些桌面应用程序的功能,被称为“小应用程序”。

Servlet是用于WEB服务器端的Java小程序,它在WEB服务器端被解释执行,用于处理客户端的请求和产生动态网页内容。

源于Applet的命名,这种WEB服务器端的Java小程序就被命名为了Servlet,与Applet相对应,Servlet可以被称之为“小服务程序”。

Servlet与普通java程序相比,只是输入信息的来源和输出结果的目标不一样,所以,普通Java程序所能完成的大多数任务,Servlet程序都可以完成。

Servlet程序具有如下的一些基本功能:l 获取客户端通过HTML的FORM表单递交的数据和URL后面的参数信息;l 创建对客户端的响应消息内容;l 访问服务器端的文件系统;l 连接数据库并开发基于数据库的应用;l 调用其它的Java类。

Servlet是运行在服务器端的多线程纯java程序,它处理请求的信息并将信息发送到客户端。

这样说吧其实你的JSP页面在客户端请求过后会由WEB容器转译成Servlet源代码,再将Servlet源代码经过编译加载到内存中执行,最后把结果响应给客户端。

====================================================================== =========================================servlet简介servlet容器:负责处理客户请求、把请求传送给servlet并把结果返回给客户。

外文文献翻译-JSP发展历史中英文

外文文献翻译-JSP发展历史中英文

JSP的技术发展历史作者:Kathy Sierra and Bert Bates来源:Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java 脚本语言—— server—side JavaScript(SSJS)和微软的Active Server Pages(ASP)。

与SSJS和ASP相比,JSP具有更好的可扩展性,并且它不专属于任何一家厂商或某一特定的Web服务器。

尽管JSP规范是由Sun公司制定的,但任何厂商都可以在自己的系统上实现JSP。

在Sun正式发布JSP(Java Server Pages)之后,这种新的Web应用开发技术很快引起了人们的关注。

JSP为创建高度动态的Web应用提供了一个独特的开发环境。

按照Sun的说法,JSP能够适应市场上包括Apache WebServer、IIS4.0在内的85%的服务器产品。

本文将介绍JSP相关的知识,以及JavaBean的相关内容,当然都是比较粗略的介绍其中的基本内容,仅仅起到抛砖引玉的作用,如果读者需要更详细的信息,请参考相应的JSP的书籍。

1。

1 概述JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准,其在动态网页的建设中有其强大而特别的功能。

JSP与Microsoft的ASP技术非常相似.两者都提供在HTML代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。

下面我们简单的对它进行介绍.JSP页面最终会转换成servlet。

因而,从根本上,JSP页面能够执行的任何任务都可以用servlet 来完成。

然而,这种底层的等同性并不意味着servlet和JSP页面对于所有的情况都等同适用.问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。

毕竟,在特定平台上能够用Java 编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要.和单独使用servlet相比,JSP提供下述好处:1)JSP中HTML的编写与维护更为简单。

计算机外文翻译---JSP应用框架

计算机外文翻译---JSP应用框架

外文翻译原文及译文JSP application frameworksWhat are application frameworks:A framework is a reusable, semi-complete application that can be specialized toproduce custom applications [Johnson]. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products.A framework provides developers with a set of backbone components that have the following characteristics:1.They are known to work well in other applications.2. They are ready to use with the next project.3. They can also be used by other teams in the organization.Frameworks are the classic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before you can roll your own? If you buy it, you will have to climb the learning curve—and how long is that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projects.Other types of frameworks:The idea of a framework applies not only to applications but to application componentsas well. Throughout this article, we introduce other types of frameworks that you can use with Struts. These include the Lucene search engine, the Scaffold toolkit, the Struts validator, and the Tiles tag library. Like application frameworks, these tools providecomponent.Some frameworks have been linked to a proprietary development environment. This is not the case with Struts or any of the other frameworks shown in this book. You can use any development environment with Struts: Visual Age for Java, JBuilder, Eclipse, Emacs, and Textpad are all popular choices among Struts developers. If you can use it with Java, you can use it with Struts.Enabling technologies:Applications developed with Struts are based on a number of enabling technologies.These components are not specific to Struts and underlie every Java web application. A reason that developers use frameworks like Struts is to hide the nasty details behind acronyms like HTTP, CGI, and JSP. As a Struts developer, you don’t need to be an alphabet soup guru, but a working knowledge of these base technologies can help you devise creative solutions to tricky problems.Hypertext Transfer Protocol (HTTP):When mediating talks between nations, diplomats often follow a formal protocol.Diplomatic protocols are designed to avoid misunderstandings and to keep negotiations from breaking down. In a similar vein, when computers need to talk, they also follow a formal protocol. The protocol defines how data is transmitted and how to decode it once it arrives. Web applications use the Hypertext Transfer Protocol (HTTP) to move data between the browser running on your computer and the application running on the server.Many server applications communicate using protocols other than HTTP. Some of these maintain an ongoing connection between the computers. The application server knows exactly who is connected at all times and can tell when a connection is dropped. Because they know the state of each connection and the identity of each person using it, these are known as stateful protocols.By contrast, HTTP is known as a stateless protocol. An HTTP server will accept any request from any client and will always provide some type of response, even if the response is just to say no. Without the overhead of negotiating and retaining a connection, stateless protocols can handle a large volume of requests. This is one reason why theInternet has been able to scale to millions of computers.Another reason HTTP has become the universal standard is its simplicity. An HTTP request looks like an ordinary text document. This has made it easy for applications to make HTTP requests. You can even send an HTTP request by hand using a standard utility such as Telnet. When the HTTP response comes back, it is also in plain text that developers can read.The first line in the HTTP request contains the method, followed by the locationof the requested resource and the version of HTTP. Zero or more HTTP request headers follow the initial line. The HTTP headers provide additional information to the server. This can include the browser type and version, acceptable document types, and the browser’s cookies, just to name a few. Of the s even request methods, GET and POST are by far the most popular.Once the server has received and serviced the request, it will issue an HTTP response. The first line in the response is called the status line and carries the HTTP protocol version, a numeric status, and a brief description of the status. Following the status line, the server will return a set of HTTP response headers that work in a way similar to the request headers.As we mentioned, HTTP does not preserve state information between requests.The server logs the request, sends the response, and goes blissfully on to the next request. While simple and efficient, a stateless protocol is problematic for dynamic applications that need to keep track of their users. (Ignorance is not always bliss.Cookies and URL rewriting are two common ways to keep track of users between requests. A cookie is a special packet of information on the user’s computer. URL rewriting stores a special reference in the page address that a Java server can use to track users. Neither approach is seamless, and using either means extra work when developing a web application. On its own, a standard HTTP web server does not traffic in dynamic content. It mainly uses the request to locate a file and then returns that file in the response. The file is typically formatted using Hypertext Markup Language (HTML) [W3C, HTML] that the web browser can format and display. The HTML page often includes hypertext links to other web pages and may display any number of other goodies, such as images andvideos. The user clicks a link to make another request, and the process begins a new.Standard web servers handle static content and images quite well but need a helping hand to provide users with a customized, dynamic response.DEFINITION:Static content on the Web comes directly from text or data files, like HTML or JPEG files. These files might be changed from time to time, but they are not altered automatically when requested by a web browser. Dynamic content, on the other hand, is generated on the fly, typically in response to an individualized request from a browser.Common Gateway Interface (CGI):The first widely used standard for producing dynamic content was the Common Gateway Interface (CGI). CGI uses standard operating system features, such as environment variables and standard input and output, to create a bridge, or gateway, between the web server and other applications on the host machine. The other applications can look at the request sent to them by the web server and create a customized response.When a web server receives a request that’s intended for a CGI program, it runs that program and provides the program with information from the incoming request. The CGI program runs and sends its output back to the server. The web server then relays the response to the browser.CGI defines a set of conventions regarding what information it will pass as environment variables and how it expects standard input and output to be used. Like HTTP, CGI is flexible and easy to implement, and a great number of CGI-aware programs have been written.The main drawback to CGI is that it must run a new copy of the CGI-aware program for each request. This is a relatively expensive process that can bog down high-volume sites where thousands of requests are serviced per minute. Another drawback is that CGI programs tend to be platform dependent. A CGI program written for one operating system may not run on another.Java servlets:Sun’s Java Servlet platform directly addresses the two main drawbacks of CGIconventional CGI programs. Second, the write-once, run-anywhere nature of Java means that servlets are portable between operating systems that have a Java Virtual Machine (JVM).A servlet looks and feels like a miniature web server. It receives a request and renders a response. But, unlike conventional web servers, the servlet application programming interface (API) is specifically designed to help Java developers create dynamic applications.The servlet itself is simply a Java class that has been compiled into byte code, like any other Java object. The servlet has access to a rich API of HTTP-specific services, but it is still just another Java object running in an application and can leverage all your other Java assets.To give conventional web servers access to servlets, the servlets are plugged into containers. The servlet container is attached to the web server. Each servlet can declare what URL patterns it would like to handle. When a request matching a registered pattern arrives, the web server passes the request to the container, and the container invokes the servlet.But unlike CGI programs, a new servlet is not created for each request. Once the container instantiates the servlet, it will just create a new thread for each request. Java threads are much less expensive than the server processes used by CGI programs. Once the servlet has been created, using it for additional requests incurs very little overhead. Servlet developers can use the init() method to hold references to expensive resources, such as database connections or EJB Home Interfaces, so that they can be shared between requests. Acquiring resources like these can take several seconds—which is longer than many surfers are willing to wait.The other edge of the sword is that, since servlets are multithreaded, servlet developers must take special care to be sure their servlets are thread-safe. To learn more about servlet programming, we recommend Java Servlets by Example, by Alan R. Williamson [Williamson]. The definitive source for Servlet information is the Java Servlet Specification [Sun, JST].JavaServer Pages:While Java servlets are a big step up from CGI programs, they are not a panacea. To generate the response, developers are still stuck with using println statements to render the HTML. Code that looks like:out.println("<P>One line of HTML.</P>");out.println("<P>Another line of HTML.</P>");is all too common in servlets that generate the HTTP response. There are libraries that can help you generate HTML, but as applications grow more complex, Java developers end up being cast into the role of HTML page designers.Meanwhile, given the choice, most project managers prefer to divide development teams into specialized groups. They like HTML designers to be working on the presentation while Java engineers sweat the business logic. Using servlets alone encourages mixing markup with business logic, making it difficult for team members to specialize.To solve this problem, Sun turned to the idea of using server pages to combine scripting and templating technologies into a single component. To build Java Server Pages, developers start by creating HTML pages in the same old way, using the same old HTML syntax. To bring dynamic content into the page, the developer can also place JSP scripting elements on the page. Scripting elements are tags that encapsulate logic that is recognized by the JSP. You can easily pick out scripting elements on JSP pages by looking for code that begins with <% and ends with %>.To be seen as a JSP page, the file just needs to be saved with an extension of .jsp.When a client requests the JSP page, the container translates the page into a source code file for a Java servlet and compiles the source into a Java class file—just as you would do if you were writing a servlet from scratch. At runtime, the container can also check the last modified date of the JSP file against the class file. If the JSP file has changed since it was last compiled, the container will retranslate and rebuild the page all over again.Project managers can now assign the presentation layer to HTML developers, who then pass on their work to Java developers to complete the business-logic portion. The important thing to remember is that a JSP page is really just a servlet. Anything you can do with a servlet, you can do with a JSP.JavaBeans:JavaBeans are Java classes which conform to a set of design patterns that make them easier to use with development tools and other components.DEFINITION A JavaBean is a reusable software component written in Java. To qualify as a JavaBean, the class must be concrete and public, and have a noargument constructor. JavaBeans expose internal fields as properties by providing public methods that follow a consistent design pattern. Knowing that the property names follow this pattern, other Java classes are able to use introspection to discover and manipulate JavaBean properties.The JavaBean design patterns provide access to the bean’s internal stat e through two flavors of methods: accessors are used to read a JavaBean’s state; mutators are used to change a JavaBean’s state.Mutators are always prefixed with lowercase token set followed by the property name. The first character in the property name must be uppercase. The return value is always void—mutators only change property values; they do not retrieve them. The mutator for a simple property takes only one parameter in its signature, which can be of any type. Mutators are often nicknamed setters after their prefix. The mutator method signature for a weight property of the type Double would be:public void setWeight(Double weight)A similar design pattern is used to create the accessor method signature. Accessor methods are always prefixed with the lowercase token get, followed by the property name. The first character in the property name must be uppercase. The return value will match the method parameter in the corresponding mutator. Accessors for simple properties cannot accept parameters in their method signature. Not surprisingly, accessors are often called getters.The accessor method signature for our weight property is:public Double getWeight()If the accessor returns a logical value, there is a variant pattern. Instead of using the lowercase token get, a logical property can use the prefix is, followed by the property name.be a logical value—either boolean or Boolean. Logical accessors cannot accept parameters in their method signature.The boolean accessor method signature for an on property would bepublic boolean isOn()The canonical method signatures play an important role when working with Java- Beans. Other components are able to use the Java Reflec tion API to discover a JavaBean’s properties by looking for methods prefixed by set, is, or get. If a component finds such a signature on a JavaBean, it knows that the method can be used to access or change the bean’s properties.Sun introduced JavaBeans to work with GUI components, but they are now used with every aspect of Java development, including web applications. When Sun engineers developed the JSP tag extension classes, they designed them to work with JavaBeans. The dynamic data for a page can be passed as a JavaBean, and the JSP tag can then use the bean’s properties to customize the output.For more on JavaBeans, we highly recommend The Awesome Power of JavaBeans, by Lawrence H. Rodrigues [Rodrigues]. The definitive source for JavaBean information is the JavaBean Specification [Sun, JBS].Model 2:The 0.92 release of the Servlet/JSP Specification described Model 2 as an architecture that uses servlets and JSP pages together in the same application. The term Model 2 disappeared from later releases, but it remains in popular use among Java web developers.Under Model 2, servlets handle the data access and navigational flow, while JSP pages handle the presentation. Model 2 lets Java engineers and HTML developers each work on their own part of the application. A change in one part of a Model 2 application does not mandate a change to another part of the application. HTML developers can often change the look and feel of an application without changing how the back-office servlets work.The Struts framework is based on the Model 2 architecture. It provides a controller servlet to handle the navigational flow and special classes to help with the data access. Awith JSP pages.Summary:In this article, we introduced Struts as an application framework. We examined the technology behind HTTP, the Common Gateway Interface, Java servlets, JSPs, and JavaBeans. We also looked at the Model 2 application architecture to see how it is used to combine servlets and JSPs in the same application.Now that you have had a taste of what it is like to develop a web application with Struts, in chapter 2 we dig deeper into the theory and practice behind the Struts architecture.JSP 应用框架什么是应用框架:框架(framework)是可重用的,半成品的应用程序,可以用来产生专门的定制程序。

【计算机专业文献翻译】JSP概述

【计算机专业文献翻译】JSP概述

JSP介绍J2EE(Java2企业版)已经承担起了曾经很混乱的建立互联网平台的任务,并使开发者们能够使用Java来高效地创建多层服务器端应用程序。

现今,Java企业版的API已经扩展为涵盖了众多领域:用于远程对象处理的RMI和CORBA,用于数据库交互的JDBC,用于访问命名和目录服务的JNDI,用于创建可重用商务组件的企业级JavaBeans(EJB),用于面向消息的中间件的JMS TM(Java Messaging Service,Java消息服务),用于XML处理的JAXP TM,以及用于执行原子性(atomic)事务的JTA TM(Java Transaction API,Java事务API)。

另外,J2EE还支持servlets是一种非常流行的用于替代CGI脚本的Java小程序。

这些技术的组合使得程序员可以为各种不同的任务创建分布式的商务解决方案。

在1999年末,Sun Microsystems公司向企业级Java工具集中加入了一个新的元素:Java Server Pages(JSP,Java服务器页面)。

JSP建立在Java servlet之上,它的设计目的是使程序员乃至非程序员都能高效地创建Web内容。

什么是JSP?简明扼要地说,JSP是一种用来开发含有动态内容网页的技术。

纯HTML页面只包含静态的内容,它的内容通常保持不变,而JSP页面则不同,它可以根据任意数量的变量来改变自己的内容,这些变量包括用户的身份信息,用户使用的浏览器类型,用户提供的信息,以及用户所做的选择等。

JSP页面就和常规的网页一样,包含标准的标记语言元素,例如HTML的标签。

然而,JSP页面还包含特殊的JSP元素,这些元素使得服务器可以把动态内容插入到网页中。

JSP 元素的用途非常广泛,例如从数据库取得信息,或记录用户的个性信息。

当用户请求一个JSP页面时,服务器先执行JSP元素,并把结果同网页的静态部分相结合,然后把动态合成后的页面送回到浏览器。

javaweb英文参考文献

javaweb英文参考文献

javaweb英文参考文献下面是关于JavaWeb的参考文献的相关参考内容,字数超过了500字:1. Banic, Z., & Zrncic, M. (2013). Modern Java EE Design Patterns: Building Scalable Architecture for Sustainable Enterprise Development. Birmingham, UK: Packt Publishing Ltd. This book provides an in-depth exploration of Java EE design patterns for building scalable and sustainable enterprise applications using JavaWeb technologies.2. Sharma, S., & Sharma, R. K. (2017). Java Web Services: Up and Running. Sebastopol, CA: O'Reilly Media. This book provides a comprehensive guide to building Java Web services using industry-standard technologies like SOAP, REST, and XML-RPC.3. Liang, Y. D. (2017). Introduction to Java Programming: Brief Version, 11th Edition. Boston, MA: Pearson Education. This textbook introduces Java programming concepts and techniques, including JavaWeb development, in a concise and easy-to-understand manner. It covers topics such as servlets, JSP, and JavaServer Faces.4. Ambler, S. W. (2011). Agile Modeling: Effective Practices for Extreme Programming and the Unified Process. Hoboken, NJ: John Wiley & Sons. This book discusses agile modeling techniques for effective JavaWeb development, including iterative and incremental development, test-driven development, and refactoring.5. Bergeron, D. (2012). Java and XML For Dummies. Hoboken, NJ: John Wiley & Sons. This beginner-friendly book provides an introduction to using XML in JavaWeb development, covering topics such as XML parsing, JAXB, and XML Web services.6. Cadenhead, R. L., & Lemay, L. (2016). Sams Teach Yourself Java in 21 Days, 8th Edition. Indianapolis, IN: Sams Publishing. This book offers a step-by-step approach to learning Java, including JavaWeb development. It covers important topics such as servlets, JSP, and JavaServer Faces.7. Balderas, F., Johnson, S., & Wall, K. (2013). JavaServer Faces: Introduction by Example. San Francisco, CA: Apress. This book provides a practical introduction to JavaServer Faces (JSF), a web application framework for building JavaWeb user interfaces. It includes numerous examples and case studies.8. DeSanno, N., & Link, M. (2014). Beginning JavaWeb Development. New York, NY: Apress. This book serves as a comprehensive guide to JavaWeb development, covering topics such as servlets, JSP, JavaServer Faces, and JDBC.9. Murach, J. (2014). Murach's Java Servlets and JSP, 3rd Edition. Fresno, CA: Mike Murach & Associates. This book provides a deep dive into Java servlets and JSP, two core technologies for JavaWeb development. It includes practical examples and exercises.10. Horstmann, C. (2018). Core Java Volume II--AdvancedFeatures, 11th Edition. New York, NY: Prentice Hall. This book covers advanced topics in Java programming, including JavaWeb development using technologies such as servlets, JSP, JSTL, and JSF.These references cover a wide range of topics related to JavaWeb development, from introductory to advanced concepts. They provide valuable insights, examples, and practical guidance for developers interested in building web applications using Java technologies.。

servlet通俗易懂的基本介绍

servlet通俗易懂的基本介绍

1、Servlet和JSP概述1.1 Java Servlet及其特点Servlet是Java技术对CGI编程的回答。

Servlet程序在服务器端运行,动态地生成Web页面。

与传统的CGI和许多其他类似CGI的技术相比,Java Servlet具有更高的效率,更容易使用,功能更强大,具有更好的可移植性,更节省投资(更重要的是,Servlet程序员收入要比Perl程序员高:-):⏹高效。

在传统的CGI中,每个请求都要启动一个新的进程,如果CGI程序本身的执行时间较短,启动进程所需要的开销很可能反而超过实际执行时间。

而在Servlet中,每个请求由一个轻量级的Java线程处理(而不是重量级的操作系统进程)。

在传统CGI中,如果有N个并发的对同一CGI程序的请求,则该CGI程序的代码在内存中重复装载了N 次;而对于Servlet,处理请求的是N个线程,只需要一份Servlet类代码。

在性能优化方面,Servlet也比CGI有着更多的选择,比如缓冲以前的计算结果,保持数据库连接的活动,等等。

⏹方便。

Servlet提供了大量的实用工具例程,例如自动地解析和解码HTML表单数据、读取和设置HTTP头、处理Cookie、跟踪会话状态等。

⏹功能强大。

在Servlet中,许多使用传统CGI程序很难完成的任务都可以轻松地完成。

例如,Servlet能够直接和Web服务器交互,而普通的CGI程序不能。

Servlet还能够在各个程序之间共享数据,使得数据库连接池之类的功能很容易实现。

⏹可移植性好。

Servlet用Java编写,Servlet API具有完善的标准。

因此,为I-Planet Enterprise Server写的Servlet无需任何实质上的改动即可移植到Apache、Microsoft IIS或者WebStar。

几乎所有的主流服务器都直接或通过插件支持Servlet。

⏹节省投资。

不仅有许多廉价甚至免费的Web服务器可供个人或小规模网站使用,而且对于现有的服务器,如果它不支持Servlet的话,要加上这部分功能也往往是免费的(或只需要极少的投资)。

jsp技术简介

jsp技术简介

JSP技术简介什么是JSP?JSP(JavaServer Pages)是一种用于创建动态网页的技术。

它允许开发人员将动态内容(如数据库查询结果或用户输入)嵌入到HTML页面中。

与静态网页不同,JSP页面可以根据不同的请求和数据来生成不同的输出。

JSP是基于Java编程语言的,因此开发人员可以使用Java的强大功能来实现复杂的业务逻辑。

同时,它也是在服务器端运行的,这意味着用户无需下载任何插件或软件,并且可以通过任何支持HTTP协议的浏览器访问到JSP页面。

JSP的优点1.易于学习和使用:与其他服务器端技术相比,JSP是学习曲线较为平缓的。

它是用HTML和Java代码混合编写的,因此对于熟悉HTML和Java的开发人员来说,上手相对容易。

2.代码重用:JSP页面可以通过组件、标签库和自定义标签等方式实现代码的重用。

这使得开发人员可以更加高效地开发和维护项目。

3.动态内容生成:JSP允许开发人员在HTML页面中嵌入Java代码,这使得动态内容的生成变得非常简单。

开发人员可以使用Java的强大功能处理和操作数据,从而提供与用户交互的动态页面。

4.可扩展性:JSP技术是基于Java的,可以与其他Java技术(如Servlet和EJB)无缝集成。

这使得开发人员能够构建复杂的企业级应用程序,并实现高度的可扩展性。

5.跨平台性:由于JSP是在服务器端运行的,所以它可以在任何支持Java的操作系统上运行。

这意味着开发人员可以使用一套代码在不同的操作系统上部署应用程序。

JSP的工作原理JSP的工作原理可以简单概括为以下几个步骤:1.编写JSP页面:开发人员编写JSP页面,它包含了HTML和Java代码。

Java代码通常使用特殊的标签(<% %>)来标识。

2.编译为Servlet:当第一次访问JSP页面时,容器会将JSP页面编译成一个Servlet。

这个过程是自动的,开发人员无需手动进行。

3.创建Servlet实例:每次有请求到达JSP页面时,容器都会为该请求创建一个Servlet实例。

网络工程英文文献及中文翻译servlet和jsp技术简述本科毕业论文

网络工程英文文献及中文翻译servlet和jsp技术简述本科毕业论文

毕业设计说明书英文文献及中文翻译学生姓名: 学号:学 院:专 业:指导教师:2013年6月0906064109 电子与计算机科学技术学院 网络工程An Overview of Servlet and JSP TechnologyGildas Avoine and Philippe OechslinEPFL, Lausanne, Switzerland1.1 A Servlet's JobServlets are Java programs that run on Web or application servers, acting as a middle layer between requests coming from Web browsers or other HTTP clients and databases or applications on the HTTP server. Their job is to perform the following tasks, as illustrated in Figure 1-1.Figure 1-11.Read the explicit data sent by the client.The end user normally enters this data in an HTML form on a Web page. However, the data could also come from an applet or a custom HTTP client program.2.Read the implicit HTTP request data sent by the browser.Figure 1-1 shows a single arrow going from the client to the Web server (the layer where servlets and JSP execute), but there are really two varieties of data: the explicit data that the end user enters in a form and the behind-the-scenes HTTP information. Both varieties are critical. The HTTP information includes cookies, information about media types and compression schemes the browser understands, and so on. 3.Generate the results.This process may require talking to a database, executing an RMI or EJB call, invoking a Web service, or computing the response directly. Your real data may be in a relational database. Fine. But your database probably doesn't speak HTTP or return results in HTML, so the Web browser can't talk directly to the database. Even if it could, for security reasons, you probably would not want it to. The same argumentapplies to most other applications. You need the Web middle layer to extract the incoming data from the HTTP stream, talk to the application, and embed the results inside a document.4.Send the explicit data (i.e., the document) to the client.This document can be sent in a variety of formats, including text (HTML or XML), binary (GIF images), or even a compressed format like gzip that is layered on top of some other underlying format. But, HTML is by far the most common format, so an important servlet/JSP task is to wrap the results inside of HTML.5.Send the implicit HTTP response data.Figure 1-1 shows a single arrow going from the Web middle layer (the servlet or JSP page) to the client. But, there are really two varieties of data sent: the document itself and the behind-the-scenes HTTP information. Again, both varieties are critical to effective development. Sending HTTP response data involves telling the browser or other client what type of document is being returned (e.g., HTML), setting cookies and caching parameters, and other such tasks.1.2 Why Build Web Pages Dynamically?many client requests can be satisfied by prebuilt documents, and the server would handle these requests without invoking servlets. In many cases, however, a static result is not sufficient, and a page needs to be generated for each request. There are a number of reasons why Web pages need to be built on-the-fly:1.The Web page is based on data sent by the client.For instance, the results page from search engines and order-confirmation pages at online stores are specific to particular user requests. You don'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 (i.e., HTML form data) and implicit (i.e., HTTP request headers). Either kind of input can be used to build the output page. In particular, it is quite common to build a user-specific 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 server-side sources.If the information is in a database, you need server-side 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; you need to talk to the database. Going from the client to the Web tier to the database (a three-tier approach) instead of from an applet directly to a database (a two-tier approach) provides increased flexibility and security with little or no performance penalty. After all, the database call is usually the rate-limiting step, so going through the Web server does not slow things down. In fact, a three-tier approach is often faster because the middle tier can perform caching and connection pooling.In principle, servlets are not restricted to Web or application servers that handle HTTP requests but can be used for other types of servers as well. For example, servlets could be embedded in FTP or mail servers to extend their functionality. And, a servlet API for SIP (Session Initiation Protocol) servers was recently standardized (see /en/jsr/detail?id=116). In practice, however, this use of servlets has not caught on, and we'll only be discussing HTTP servlets.1.3 The Advantages of Servlets Over "Traditional" CGIJava servlets are more efficient, easier to use, more powerful, more portable, safer,and cheaper than traditional CGI and many alternative CGI-like technologies. 1.EfficientWith 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 computations, keep database connections open, and perform other optimizations that rely on persistent data. Servlets, however, remain in memory even after they complete a response, so it is straightforward to store arbitrarily complex data between client requests. 2.ConvenientServlets 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 high-level utilities. In CGI, you have to do much of this yourself. Besides, if you already know the Java programming language, why learn Perl too? You're already convinced that Java technology makes for more reliable and reusable code than does Visual Basic, VBScript, or C++. Why go back to those languages for server-side programming?3.PowerfulServlets support several capabilities that are difficult or impossible to accomplish with regular CGI. Servlets can talk directly to the Web server, whereas regular CGI programs cannot, at least not without using a server-specific API. Communicating with the Web server makes it easier to translate relative URLs into concrete path names, for instance. Multiple servlets can also share data, making it easy to implement database connection pooling and similar resource-sharing optimizations.Servlets can also maintain information from request to request, simplifying techniques like session tracking and caching of previous computations.4.PortableServlets are written in the Java programming language and follow a standard API. Servlets are supported directly or by a plugin on virtually every major Web server. Consequently, servlets written for, say, Macromedia JRun can run virtually unchanged on Apache Tomcat, Microsoft Internet Information Server (with a separate plugin), IBM WebSphere, iPlanet Enterprise Server, Oracle9i AS, or StarNine WebStar. They are part of the Java 2 Platform, Enterprise Edition, so industry support for servlets is becoming even more pervasive.5.InexpensiveA number of free or very inexpensive Web servers are good for development use or deployment of low- or medium-volume Web sites. Thus, with servlets and JSP you can start with a free or inexpensive server and migrate to more expensive servers with high-performance capabilities or advanced administration utilities only after your project meets initial success. This is in contrast to many of the other CGI alternatives, which require a significant initial investment for the purchase of a proprietary package.Price and portability are somewhat connected. For example, Marty tries to keep track of the countries of readers that send him questions by email. India was near the top of the list, probably #2 behind the U.S. Marty also taught one of his JSP and servlet training courses (see /) in Manila, and there was great interest in servlet and JSP technology there.Now, why are India and the Philippines both so interested? We surmise that the answer is twofold. First, both countries have large pools of well-educated software developers. Second, both countries have (or had, at that time) highly unfavorable currency exchange rates against the U.S. dollar. So, buying a special-purpose Web server from a U.S. company consumed a large part of early project funds.But, with servlets and JSP, they could start with a free server: Apache Tomcat (either standalone, embedded in the regular Apache Web server, or embedded inMicrosoft IIS). Once the project starts to become successful, they could move to a server like Caucho Resin that had higher performance and easier administration but that is not free. But none of their servlets or JSP pages have to be rewritten. If their project becomes even larger, they might want to move to a distributed (clustered) environment. No problem: they could move to Macromedia JRun Professional, which supports distributed applications (Web farms). Again, none of their servlets or JSP pages have to be rewritten. If the project becomes quite large and complex, they might want to use Enterprise JavaBeans (EJB) to encapsulate their business logic. So, they might switch to BEA WebLogic or Oracle9i AS. Again, none of their servlets or JSP pages have to be rewritten. Finally, if their project becomes even bigger, they might move it off of their Linux box and onto an IBM mainframe running IBM WebSphere. But once again, none of their servlets or JSP pages have to be rewritten.6.SecureOne of the main sources of vulnerabilities in traditional CGI stems from the fact that the programs are often executed by general-purpose operating system shells. So, the CGI programmer must be careful to filter out characters such as backquotes and semicolons that are treated specially by the shell. Implementing this precaution is harder than one might think, and weaknesses stemming from this problem are constantly being uncovered in widely used CGI libraries.A second source of problems is the fact that some CGI programs are processed by languages that do not automatically check array or string bounds. For example, in C and C++ it is perfectly legal to allocate a 100-element array and then write into the 999th "element," which is really some random part of program memory. So, programmers who forget to perform this check open up their system to deliberate or accidental buffer overflow attacks.Servlets suffer from neither of these problems. Even if a servlet executes a system call (e.g., with Runtime.exec 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.MainstreamThere are a lot of good technologies out there. But if vendors don't support them and developers don't know how to use them, what good are they? Servlet and JSP technology is supported by servers from Apache, Oracle, IBM, Sybase, BEA, Macromedia, Caucho, Sun/iPlanet, New Atlanta, ATG, Fujitsu, Lutris, Silverstream, the World Wide Web Consortium (W3C), and many others. Several low-cost plugins add support to Microsoft IIS and Zeus as well. They run on Windows, Unix/Linux, MacOS, VMS, and IBM mainframe operating systems. They are the single most popular application of the Java programming language. They are arguably the most popular choice for developing medium to large Web applications. They are used by the airline industry (most United Airlines and Delta Airlines Web sites), e-commerce (), online banking (First USA Bank, Banco Popular de Puerto Rico), Web search engines/portals (), large financial sites (American Century Investments), and hundreds of other sites that you visit every day.Of course, popularity alone is no proof of good technology. Numerous counter-examples abound. But our point is that you are not experimenting with a new and unproven technology when you work with server-side Java.Servlet和JSP技术简述Gildas Avoine and Philippe OechslinEPFL, Lausanne, Switzerland1.1 Servlet的功能Servlets是运行在Web或应用服务器上的Java程序,它是一个中间层,负责连接来自Web浏览器或其他HTTP客户程序的请求和HTTP服务器上的数据库或应用程序。

外文翻译---JSP简介

外文翻译---JSP简介

附录1JSP ProfileJSP (JavaServer Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*. htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*. jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems. JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy.Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function.JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit. JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced.JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure, mainly for all the characteristics of the Internet.JSP technology strength(1) time to prepare, run everywhere. At this point Java better than PHP, in addition to systems, the code not to make any changes.(2) the multi-platform support. Basically on all platforms of any development environment, in any environment for deployment in any environment in the expansion. Compared ASP / PHP limitations are obvious.(3) a strong scalability. From only a small Jar documents can run Servlet / JSP, to the multiple servers clustering and load balancing, to multiple Application for transaction processing, information processing, a server to numerous servers, Java shows a tremendous Vitality.(4) diversification and powerful development tools support. This is similar tothe ASP, Java already have many very good development tools, and many can be free, and many of them have been able to run on a variety of platforms under.JSP technology vulnerable(1) and the same ASP, Java is the advantage of some of its fatal problem. It is precisely because in order to cross-platform functionality, in order to extreme stretching capacity, greatly increasing the complexity of the product.(2) Java's speed is class to complete the permanent memory, so in some cases by the use of memory compared to the number of users is indeed a "minimum cost performance." On the other hand, it also needs disk space to store a series of. Java documents and. Class, as well as the corresponding versions of documents.JSP six built-in objects:request, response, out, session, application, config, pagecontext, page, exception.1. Request for:The object of the package of information submitted by users, by calling the object corresponding way to access the information package, namely the use of the target users can access the information.2. Response object:The customer's request dynamic response to the client sent the data.3. session object1. What is the session: session object is a built-in objects JSP, it in the first JSP pages loaded automatically create, complete the conversation of management.From a customer to open a browser and connect to the server, to close the browser, leaving the end of this server, known as a conversation. When a customer visits a server, the server may be a few pages link between repeatedly, repeatedly refresh a page, the server should be through some kind of way to know this is the same client, which requires session object.2. session object ID: When a customer's first visit to a server on the JSP pages, JSP engines produce a session object, and assigned a String type of ID number, JSP engine at the same time, the ID number sent to the client, stored in Cookie, this session objects, and customers on the establishment of a one-to-one relationship. When a customer to connect to the server of the other pages, customers no longer allocated to the new session object, until, close your browser, the client-server object to cancel the session, and the conversation, and customer relationship disappeared. When a customer re-open the browser to connect to the server, the server for the customer to create a new session object.4. aplication target1. What is the application:Servers have launched after the application object, when a customer to visit the site between the various pages here, this application objects are the same, until the server is down. But with the session difference is that all customers of the application objects are the same, that is, all customers share this built-in application objects.2. application objects commonly used methods:(1) public void setAttribute (String key, Object obj): Object specified parameters will be the object obj added to the application object, and to add the subject of the designation of a keyword index.(2) public Object getAttribute (String key): access to application objects containing keywords for.5. out targetsout as a target output flow, used to client output data. out targets for the output data.6. Cookie1. What is Cookie: Cookie is stored in Web server on the user's hard drive section of the text. Cookie allow a Web site on the user's computer to store information on and then get back to it. For example, a Web site may be generated for each visitor a unique ID, and then to Cookie in the form of documents stored in each user's machine. If you use IE browser to visit Web, you will see all stored on your hard drive on the Cookie. They are most often stored in places: c: \ windows \ cookies (in Window2000 is in the C: \ Documents and Settings \ your user name \ Cookies) Cookie is "keyword key = value value" to preserve the format of the record.2. Targets the creation of a Cookie, Cookie object called the constructor can create a Cookie. Cookie object constructor has two string parameters: Cookie Cookie name and value. Cookie c = new Cookie ( "username", "john");3. If the JSP in the package good Cookie object to send to the client, the use of the response addCookie () method.Format: response.addCookie (c)4. Save to read the client's Cookie, the use of the object request getCookies () method will be implemented in all client came to an array of Cookie objects in the form of order, to meet the need to remove the Cookie object, it is necessary to compare an array cycle Each target keywords.JSP简介JSP(JavaServer Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。

简述jsp的工作原理通俗

简述jsp的工作原理通俗

简述jsp的工作原理通俗JSP(Java Server Pages)是一种用于创建动态网页的技术,其工作原理可以简单概括为以下几个步骤:1. 客户端向服务器发送请求。

当用户在浏览器中访问一个包含JSP文件的网页时,客户端会向服务器发送请求,请求获取该网页的内容。

2. 服务器接收并解析JSP文件。

服务器接收到客户端的请求后,会找到对应的JSP文件并开始解析。

JSP文件本质上是一个HTML文件,其中包含一些用Java代码嵌入的特殊标记。

3. JSP编译为Java代码。

在解析JSP文件时,服务器会将其中的Java代码提取出来,并将其转换为一段Java程序。

4. Java代码编译为类文件。

服务器将这段Java程序编译为一个类文件,可以通过Java的编译器进行编译,得到可执行的代码。

5. 创建JSP的Servlet。

服务器会使用这个类文件创建一个Servlet实例,Servlet是JavaWeb中处理HTTP请求和响应的组件。

6. 服务器执行Servlet。

Servlet实例会使用Java代码处理请求,执行其中的逻辑操作。

例如,生成动态内容、访问数据库或调用其他Java类等。

7. 生成动态网页内容。

Servlet根据Java代码的逻辑生成动态的HTML内容,可以将其与静态的HTML代码进行结合。

8. 服务器将动态网页内容发送给客户端。

服务器将生成的HTML内容作为响应发送给客户端浏览器。

9. 浏览器渲染并显示网页。

最后,浏览器接收到服务器响应后,将动态生成的HTML内容解析和渲染,并以可视化的形式呈现给用户。

总结来说,JSP的工作原理是将JSP文件中嵌入的Java代码经过编译和执行,最终生成动态的HTML内容,并在服务器和客户端之间进行传输,最终呈现给用户。

这样,就能实现在网页上展示动态数据或执行动态操作的功能。

外文翻译---JSP简介

外文翻译---JSP简介

JSP introducedJSP (Java Server Pages) is Corporation initiates one kind of dynamic homepage technical standard by Sun Microsystems which, many companies participation establishes together. This technology has provided for the foundation demonstration dynamic production content Web page simple and direct and the fast method. The JSP technology design goal is makes the structure to be easier based on the Webapp lication procedure and quickly, but these application procedures can with each kind of Web server, using the server, the browser and the development kit work together. The JSP standard is the Web server, applies the server, the transaction system, as well as between the development kit supplier the broad cooperation result. In the traditional homepage HTML document (*htm, * html) center joins the Java procedure fragment (Scriptlet) and the JSP mark (tag), constituted the JSP homepage (* jsp). The Web server when meets visits the JSP homepage the request, first carries out procedure fragment, then will carry out the result to return by the HTML form for the customer. The procedure fragment may operate the database, again the directional homepage as well as transmits email and so on, this is a function which the establishment dynamic website needs. All procedures operation all in the server end execution, in the network transmits the result which only is obtains for the customer end, is lowest to the client browser request, may realize does not have Plugin, does not have ActiveX, non- Java Applet, even does not have Frame.JSP简介J SP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。

计算机 JSP web 外文翻译 外文文献 英文文献

计算机 JSP web 外文翻译 外文文献 英文文献

外文资料所译外文资料:①作者:Dan Malks②书名:Professional JSP③出版时间: 2000.7.26④所译章节: Chapter 1212.1IntroductoryGood Web application design tries to separate business objects, presentation, and manipulation of the objects into distinct layers. One benefit of using JavaServer Pages technology is that it allows us to separate the role of a Web designer more clearly from that of a software developer. While on a small-scale project, one individual may occupy both roles, on a larger project, they are likely to be separate and it is beneficial to separate their workflows as much as possible. Designing the architecture for your Web application is crucial to this separation.12.2 JSP architectureWe will examine a variety of ways to architect a system with JavaServer Pages, servlets, and JavaBeans. We will see a series of different architectures, each a development of the one before. The diagram below shows this process in outline; the individual parts of the diagram will be explained in turn later in this article.JSP architecture:When Sun introduced Java Server Pages, some were quick to claim that servlets had been replaced as the preferred request handling mechanism in Web-enabled enterprise architectures. Although JSP is a key component of the Java 2 Platform Enterprise Edition (J2EE) specification, serving as the preferred request handler and response mechanism, we must investigate further to understand its relationship with servlets.Other sections of Professional JSP explain the implementation details of JSP source translation and compilation into a servlets. Understanding that JSP is built on top of the servlet API, and uses servlet semantics, raises some interesting questions. Should we no longer develop stand-alone servlets in our Web-enabled systems? Is there some way to combine servlets and JSPs? If so, where do we place our Java code? Are there any other components involved in the request processing, such as JavaBeans? If so, where do they fit into the architecture and what type of role do they fulfill?It is important to understand that, although JSP technology will be a powerful successor to basic servlets, they have an evolutionary relationship and can be used in a cooperative and complementary manner.Given this premise, we will investigate how these two technologies, each a Java Standard Extension, can be used co-operatively along with other components, such as JavaBeans, to create Java-based Web-enabled systems. We will examine architecturalissues as they relate to JSP and servlets and discuss some effective designs while looking at the tradeoffs of each. Before jumping directly into a discussion of specific architectures, though, we will briefly examine the need to develop a variety of architectures.12.3 Code factoring and role separationOne of the main reasons why the JavaServer Pages technology has evolved into what it is today (and it's still evolving) is the overwhelming technical need to simplify application design by separating dynamic content from static template display data. The foundation for JSP was laid down with the initial development of the Java Web Server from Sun, which used page compilation and focused on embedding HTML inside Java code. As applications came to be based more on business objects and n-tier architectures, the focus changed to separating HTML from Java code, while still maintaining the integrity and flexibility the technology provided.In Chapter 5, JSP Sessions, in Professional JSP, we saw how beans and objects can be bound to different contexts just by defining a certain scope. Good application design builds on this idea and tries to separate the objects, the presentation, and the manipulation of the objects into distinct, distinguishable layers.Another benefit of using JSP is that it allows us to more cleanly separate the roles of a Web production/HTML designer individual from a software developer. Remember that a common development scenario with servlets was to embed the HTML presentation markup within the Java code of the servlet itself, which can be troublesome. In our discussion, we will consider the servlet solely as a container for Java code, while our entire HTML presentation template is encapsulated within a JSP source page. The question then arises as to how much Java code should remain embedded within our JSP source pages, and if it is taken out of the JSP source page, where should it reside?Let's investigate this further. On any Web-based project, multiple roles and responsibilities will exist. For example, an individual who designs HTML pages fulfills a Web production role while someone who writes software in the Java programming language fulfills a software development role.On small-scale projects these roles might be filled by the same individual, or two individuals working closely together. On a larger project, they will likely be filled by multiple individuals, who might not have overlapping skill sets, and are less productive if made too dependent on the workflow of the other.If code that could be factored out to a mediating servlet is included instead within HTML markup, then the potential exists for individuals in the software development role and those in the Web production role to become more dependent than necessary on the progress and workflow of the other. Such dependencies may create a more error-prone environment, where inadvertent changes to code by other team members become more common.This gives us some insight into one reason why we continue to develop basic servlets: they are an appropriate container for our common Java code that has been factored out of our JSP pages, giving our software development team an area of focus that is as loosely coupled to our JSP pages as possible. Certainly, there will be a need for these same individuals to work with the JSP source pages, but the dependency is reduced, and these pages become the focus of the Web-production team instead. Of course, if the same individual fulfills both roles, as is typical on a smaller project, such dependencies are not a major concern.So, we should try to minimize the Java code that we include within our JSP page, in order to uphold this cleaner separation of developer roles. As we have discussed, some of this Java code is appropriately factored to a mediating servlet. Code that is common to multiple requests, such as authentication, is a good candidate for a mediating servlet. Such code is included in one place, the servlet, instead of potentially being cut and pasted into multiple JSPs.We will also want to remove much of our business logic and data access code from our JSP page and encapsulate it within JavaBeans, called worker or helper beans. We start to see a pattern of code movement from our JSP into two areas: a servlet (or JSP) that sits in front of the main JSP, and JavaBeans that sit in back. We refer to this common pattern as "Factor Forward -- Factor Back," as shown in the figure below:Factor Forward -- Factor Back:Another way to think about what code should be localized and encapsulated is that our JSP page should reveal as little as possible of our Java code implementation details.Rather, the page should communicate our intent by revealing the delegating messages we send to worker beans, instructing them to get state from a model, or to complete some business processing.12.4 Redirecting and forwardingRedirecting and forwarding requests in JSPs and servlets takes place often, and it is important to understand the subtle difference between these two mechanisms even though they achieve the same goal (that is, a client asks for a resource on the server and a different resource is served to it):●When a servlet or JSP resource chooses to redirect the client (using aresponse.sendRedirect(url)) the request object does not reach the second resource directly since the underlying implementation is an HTTP redirect.The server sends an HTTP 302 message back to the client telling it that the resource has moved to another URL, and that the client should access it there.The bottom line is that the lifecycle of the initial request object that was accessed in the first JSP terminates with the end of the service method in the first JSP, or with the reply from the server.●In a forward mechanism the request object is forwarded to the second resource,thus maintaining any object bindings to the request and its state, without a round trip to the client on the network. This allows the first JSP to do some work internally and then send information to the second JSP asking it to do itsbit. (Servlets used a chaining mechanism to do this). See Chapter 5, JSP Sessions, in Professional JSP to get a clearer picture of scope. JSPs and servlets can use the forwarding mechanism to delegate tasks among themselves, in the process of separating dynamic and static content.Now, let's investigate how we build these systems.12.5 ArchitecturesBefore discussing specific architectures that we can use to build systems with servlets and JSP, it is worth mentioning two basic ways of using the JSP technology. Each of the architectures discussed in this chapter will be based on one of these approaches:●The first method is referred to here as the page-centric (or client-server)approach. This approach involves request invocations being made directly to JSP page.●In the second method, the dispatcher (or n-tier) approach, a basic servlet orJSP acts as a mediator or controller, delegating requests to JSP pages and JavaBeans.We will examine these approaches in light of a simple example, which will evolve to satisfy the requirements of various scenarios. The initial scenario involves providing a Web interface for guessing statistics about a soon-to-be-born baby. The guesses are stored, and can be reviewed later by the parents, to see who has guessed the closest. As the requirement scenarios become more sophisticated, such as adding the desire for a persistence mechanism, the solution scenarios will become more sophisticated, as well. Thus, our example will evolve and we will gain an understanding of how the various architectures that we discuss will help us build a system that satisfies these requirements in an elegant and effective manner.12.6 The page-centric approachApplications built using a client-server approach have been around for some time; they consist of one or more application programs running on client machines and connecting to a server-based application to work. (A good example would be a PowerBuilder or Oracle Forms-based system.) CGIs and pre-servlet applications were generally based on this simple 2-tier model, and with the introduction of servlets, 2-tier applications could also be created in Java.This model allows JSPs or servlets direct access to some resource like a database or legacy application to service a client's request: the early JSP specifications termed this a "Model 1" programming approach. The JSP page is where the incoming request is intercepted and processed, and the response is sent back to the client;JSPs only differed from servlets in this scenario by providing cleaner code and separating code from the content by placing data access in beans.Model 1 programming approach:The advantage of such an approach is that it is siple to program,and allows the page author to Generate dynamic content easily,based upon the request and the state resources.However this architecture does not scale up well for a large number of simultaneous clients since there would be a significant amount of request processing to be performed,and each request must establish or share a potentially scarce/expensive connection to the resource in question.(A good example would be JDBC connectons in servlets or JSPs and the need for connection pools.) Indiscriminate usage of this architecture usually leads to a significant amount of Java code embedded within the JSP page,this may not seem to be much of a problem for Java developers but it is certainly an issue if the JSP pages are maintained by designers:the code tends to get in the designe’s way,and you run the risk of your code becoming corrupted when others are tweaking the look and feel.译文12.1前言好的Web应用设计试图将业务对象,简报以及操作对象分为不同的层面。

java 近三年外国文献

java 近三年外国文献

java 近三年外国文献近三年,Java语言在国际上得到了广泛应用和发展。

以下是一些近三年的相关外国文献:1. 'The Evolution of Java: Past, Present, and Future'(Java 的演进:过去,现在和未来): 该文研究了Java语言的演变历史、当前情况以及未来发展方向。

文中提到了Java 9、Java 10和Java 11的新功能和特性,如模块化、JShell和垃圾收集器的改进等。

2. 'Java 8 in Action: Lambdas, Streams, andFunctional-style Programming'(Java 8实战:Lambda表达式、流和函数式编程): 该书介绍了Java 8的新特性,如Lambda表达式、流以及函数式编程,以及如何使用它们来编写更简洁、更易于维护的代码。

3. 'Java Performance: The Definitive Guide'(Java性能:权威指南): 该书讨论了Java应用程序的性能问题和优化技术。

文中提到了一些性能测试工具和技巧,以及如何使用Java 9中的新特性来提高应用程序的性能。

4. 'Java Concurrency in Practice'(Java并发实践): 该书介绍了Java中的并发编程,包括多线程、同步、锁和线程安全等方面。

文中提供了一些最佳实践和实用技巧,以帮助开发人员编写更高效和可靠的并发应用程序。

5. 'Effective Java'(Java编程思想): 该书探讨了Java语言的最佳实践,包括类设计、异常处理、泛型、枚举、注解和Lambda表达式等方面。

文中提供了一些代码示例和实用技巧,以帮助开发人员编写更清晰、更健壮和更易于维护的Java代码。

总之,这些外国文献都反映了Java语言的发展趋势和应用方向,有助于开发人员不断提高自己的技能水平,更好地应对日益复杂的软件开发挑战。

jsp和servlet文献参考

jsp和servlet文献参考

[1]孙卫琴,李洪成.《Tomcat 与JSP Web 开发技术详解》.电子工业出版社,2003年6月:1-205[2]BruceEckel.《JSP编程思想》. 机械工业出版社,2003年10月:1-378[3]FLANAGAN.《JSP技术手册》. 中国电力出版社,2002年6月:1-465[4]孙一林,彭波.《JSP数据库编程实例》. 清华大学出版社,2002年8月:30-210[5]LEE ANNE PHILLIPS.《巧学活用HTML4》.电子工业出版社,2004年8月:1-319[6]飞思科技产品研发中心.《JSP应用开发详解》.电子工业出版社,2003年9月:32-300。

[7]耿祥义,张跃平.《JSP实用教程》. 清华大学出版社,2003年5月1日:1-354[8]孙涌.《现代软件工程》.北京希望电子出版社,2003年8月:1-246[9]萨师煊,王珊.《数据库系统概论》.高等教育出版社,2002年2月:3-460[10]Brown等.《JSP编程指南(第二版)》. 电子工业出版社,2003年3月:1-268[11]清宏计算机工作室.《JSP编程技巧》. 机械工业出版社, 2004年5月:1-410[12]朱红,司光亚.《JSP Web编程指南》.电子工业出版社, 2001年9月:34-307[13]赛奎春.《JSP工程应用与项目实践》. 机械工业出版社, 2002年8月:23-[1] [美]Walter Savitch. Absolute Java[M].北京:电子工业出版社,2005.[2] 计磊,李里,周伟.J2EE整合应用案例[M].北京:人民邮电出版社,2007.[3] 王虎,张俊.管理信息系统[M].武汉:武汉理工大学出版社,2004.7.[4] 启明工作室编著.MIS系统开发与应用[M].北京:人民邮电出版社,2005.1.[5] 王珊,陈红.数据库系统原理教程[M].北京:清华大学出版社,2004.6.[6] 方睿,刁仁宏,吴四九编著.网络数据库原理及应用[M].四川:四川大学出版社,2005.8.[7] 耿祥义,张跃平编著.JAVA2实用教程(第二版)[M].北京:清华大学出版社,2004.11.1] 俞传正.基于博客的个人知识管理平台研究[D].天津:天津师范大学,2006.[2] 陈明.Blog、Wiki在协作学习中的应用研究[D].武汉:华中师范大学,2006.[3] 郭华伟.基于内容聚合BLOG学习平台的辅助教学研究与实践[D].北京:首都师范大学,2006.[4] 柳永坡,刘雪梅,赵长海.JSP应用开发技术[M].北京:人民邮电出版社,2005:30-32.[5] 耿祥义.JSP基础教程[M].北京:清华大学出版社,2004:101-103.[6] 孙卫琴、李洪成.Tomcat与Java Web开发技术详解[M].北京:电子工业出版社,2004:73-78.[7] 李海峰.基于J2EE技术开发高性能BBS论坛[D].上海:华东师范大学,2006.[8] 王夕宁,王晓平.JSP通用模块及典型系统开发实例导航[M].北京:人民邮电出版社,2006: 288-296.[9] 赛奎春.JSP信息系统开发实例精选[M].北京:机械工业出版社,2006:66-72.[10] 陈刚.Eclipse从入门到精通[M].北京:清华大学出版社, 2005:416-417.[11] 孙卫琴.精通Struts:基于MVC的Java Web设计与开发[M].北京:电子工业出版社,2004: 1-9.[12] 胡百敬,姚巧玫.SQL Server 2005 数据库开发详解[M].北京:电子工业出版社,2006:9-13,123-125.[13] (美)格罗夫著,章小莉等译. SQL完全手册(第二版)[M].北京:电子工业出版社,2006:12-14.[14] 毕建信.基于MVC设计模式的Web应用研究与实现[D].武汉:武汉理工大学,2004:10-13.[15] 贺松平.基于MVC模式的B/S架构的研究及应用[D].武汉:华中科技大学,2006:91-103.。

外文翻译---JSP的技术发展历史

外文翻译---JSP的技术发展历史

THE TECHNIQUE DEVELOPMENT HISTORY OF JSPBy:Kathy Sierra and Bert BatesSource:Servlet&JSPThe Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can carry out the JSP on own system.The After Sun release the JSP( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product.This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP.1.1 GENERALIZEThe JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it.JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.JSP provides the following benefits over servlets alone:• It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.• You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.• You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit.1.2 SOURCE OF JSPThe technique of JSP of the company of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to design to turn the end page with format. Use the perhaps small script future life of marking of JSP becomes the dynamic state on the page contents.( the contents changes according to the claim of)The Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can complete, this name of Servlet comes from the Applet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but don't do any translation, if reader would like to, can call it as" small service procedure". The Servlet is similar to traditional CGI, ISAPI, NSAPI etc. Web procedure development the function of the tool in fact, at use the Java Servlet hereafter, the customer need not use again the lowly method of CGI of efficiency, also need not use only the ability come to born page of Web of dynamic state in the method of API that a certain fixed Web server terrace circulate. Many servers of Web all support the Servlet, even not support the Servlet server of Web directly and can also pass the additional applied server and the mold pieces to support the Servlet. Receive benefit in the characteristic of the Java cross-platform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is complete to have nothing to do with terrace and is to have nothing to do with server of Web. Because the Java Servlet is internal to provide the service by the line distance, need not start a progressto the each claimses, and make use of the multi-threading mechanism can at the same time for several claim service, therefore the efficiency of Java Servlet is very high.But the Java Servlet also is not to has no weakness, similar to traditional CGI, ISAPI, the NSAPI method, the Java Servlet is to make use of to output the HTML language sentence to carry out the dynamic state web page of, if develop the whole website with the Java Servlet, the integration process of the dynamic state part and the static state page is an evil-foreboding dream simply. For solving this kind of weakness of the Java Servlet, the SUN released the JSP.A number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, Cold Fusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did.The JSP is an establishment at the model of Java servlets on of the expression layer technique, it makes the plait write the HTML to become more simple.Be like the SSJS, it also allows you carry the static state HTML contents and servers the script mix to put together the born dynamic state exportation. JSP the script language that the Java is the tacit approval, however, be like the ASP and can use other languages( such as JavaScript and VBScript), the norm of JSP also allows to use other languages.1.3JSP CHARACTERISTICSIs a service according to the script language in some one language of the statures system this kind of discuss, the JSP should be see make is a kind of script language.However, be a kind of script language, the JSP seemed to be too strong again, almost can use all Javas in the JSP.Be a kind of according to text originally of, take manifestation as the central development technique, the JSP provided all advantages of the Java Servlet, and, when combine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate. Separate the contents and advantage of logical manifestations is, the personnel who renews the page external appearance need not know the code of Java, and renew the JavaBeans personnel also need not be design the web page of expert in hand, can use to take the page of JavaBeans JSP to define the template of Web, to build up a from have the alike external appearance of the website that page constitute. JavaBeans completes the data to provide, having no code of Java in the template thus, this means that these templates can be written the personnel by a HTML plait to support. Certainly, can also make use of the Java Servlet to control the logic of the website, adjust through the Java Servlet to use the way of the document of JSP to separate website of logic and contents.Generally speaking, in actual engine of JSP, the page of JSP is the edit and translate type while carry out, not explain the type of. Explain the dynamic state web page development tool of the type, such as ASP, PHP3 etc., because speed etc. reason, have already can't satisfy current the large electronic commerce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+;PHP3 → PHP4.In the JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and must write with the Java definitely. Actually, have some engines of JSP are adoptive other script languages such as the EMAC- Script, etc., but actually this a few script languages also are to set up on the Java, edit and translate for the Servlet to carry out of. Write according to the norm of JSP, have no Scriptlet of relation with Java also is can of, however, mainly lie in the ability and JavaBeans, the Enterprise JavaBeanses because of the JSP strong function to work together, so even is the Scriptlet part not to use the Java, edit and translate of performance code also should is related with Java.1.4JSP MECHANISMTo comprehend the JSP how unite the technical advantage that above various speak of, come to carry out various result easily, the customer must understand the differentiation of" the module develops for the web page of the center" and" the page develops for the web page of the center" first.The SSJS and ASP are all in several year ago to release, the network of that time is still very young, no one knows to still have in addition to making all business, datas and theexpression logic enter the original web page entirely heap what better solve the method. This kind of model that take page as the center studies and gets the very fast development easily. However, along with change of time, the people know that this kind of method is unwell in set up large, the Web that can upgrade applies the procedure. The expression logic write in the script environment was lock in the page, only passing to shear to slice and glue to stick then can drive heavy use. Express the logic to usually mix together with business and the data logics, when this makes be the procedure member to try to change an external appearance that applies the procedure but do not want to break with its llied business logic, apply the procedure of maintenance be like to walk the similar difficulty on the eggshell. In fact in the business enterprise, heavy use the application of the module already through very mature, no one would like to rewrite those logics for their applied procedure.HTML and sketch the designer handed over to the implement work of their design the Web plait the one who write, make they have to double work- Usually is the handicraft plait to write, because have no fit tool and can carry the script and the HTML contents knot to the server to put together. Chien but speech, apply the complexity of the procedure along with the Web to promote continuously, the development method that take page as the center limits sex to become to get up obviously.At the same time, the people always at look for the better method of build up the Web application procedure, the module spreads in customer's machine/ server the realm. JavaBeans and ActiveX were published the company to expand to apply the procedure developer for Java and Windows to use to come to develop the complicated procedure quickly by" the fast application procedure development"( RAD) tool. These techniques make the expert in the some realm be able to write the module for the perpendicular application plait in the skill area, but the developer can go fetch the usage directly but need not control the expertise of this realm.Be a kind of take module as the central development terrace, the JSP appeared. It with the JavaBeans and Enterprise JavaBeans( EJB) module includes the model of the business and the data logic for foundation, provide a great deal of label and a script terraces to use to come to show in the HTML page from the contents of JavaBeans creation or send a present in return. Because of the property that regards the module as the center of the JSP, it can drive Java and not the developer of Java uses equally. Not the developer of Java can pass the JSP label( Tags) to use the JavaBeans that the deluxe developer of Java establish. The developer of Java not only can establish and use the JavaBeans, but also can use the language of Java to come to control more accurately in the JSP page according to the expression logic of the first floor JavaBeans.See now how JSP is handle claim of HTTP. In basic claim model, a claim directly was send to JSP page in. The code of JSP controls to carry on hour of the logic processing and module of JavaBeanses' hand over with each other, and the manifestation result in dynamic state bornly, mixing with the HTML page of the static state HTML code. The Beans can be JavaBeans or module of EJBs. Moreover, the more complicated claim model can see make from is request other JSP pages of the page call sign or Java Servlets.The engine of JSP wants to chase the code of Java that the label of JSP, code of Java in the JSP page even all converts into the big piece together with the static state HTML contents actually. These codes piece was organized the Java Servlet that customer can not see to go to by the engine of JSP, then the Servlet edits and translate them automatically byte code of Java.Thus, the visitant that is the website requests a JSP page, under the condition of it is not knowing, an already born, the Servlet actual full general that prepared to edit and translate completes all works, very concealment but again and efficiently. The Servlet is to edit and translate of, so the code of JSP in the web page does not need when the every time requests that page is explain. The engine of JSP need to be edit and translate after Servlet the code end is modify only once, then this Servlet that editted and translate can be carry out. The in view of the fact JSP engine auto is born to edit and translate the Servlet also, need not procedure member begins to edit and translate the code, so the JSP can bring vivid sex that function and fast developments need that you are efficiently.Compared with the traditional CGI, the JSP has the equal advantage. First, on the speed, the traditional procedure of CGI needs to use the standard importation of the system to output the equipments to carry out the dynamic state web page born, but the JSP is direct is mutually the connection with server. And say for the CGI, each interview needs to add to add a progress to handle, the progress build up and destroy by burning constantly and will be a not small burden for calculator of be the server of Web. The next in order, the JSP is specialized to develop but design for the Web of, its purpose is for building up according to the Web applied procedure, included the norm and the tool of a the whole set. Use the technique of JSP can combine a lot of JSP pages to become a Web application procedure very expediently.JSP的技术发展历史作者:Kathy Sierra and Bert Bates来源:Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

毕业设计(论文) 外文文献翻译专业学生姓名班级学号指导教师XX 学院外文资料名称:An Overview of Servletand JSP Technology外文资料出处:Internet附件: 1.外文资料翻译译文2.外文原文指导教师评语:签名:年月日Servlet和JSP技术简述Nagle and WiegleyXX译摘要:Servlet程序在服务器端运行,动态地生成Web页面与传统的CGI和许多其他类似CGI的技术相比,Java Servlet具有更高的效率,更容易使用,功能更强大,具有更好的可移植性,更节省投资。

关键字:JSP技术,Servlet,HTTP服务1.1Servlet的功能Servlets是运行在Web或应用服务器上的Java程序,它是一个中间层,负责连接来自Web浏览器或其他HTTP客户程序的请求和HTTP服务器上的数据库或应用程序。

Servlet的工作是执行西门的任务,如图1.1所示。

图1.1Web中间件的作用(1)读取客户发送的显式数据。

最终用户一般在页面的HTML表单中输入这些数据。

然而,数据还有可能来自applet或定制的HTTP客户程序。

(2)读取由浏览器发送的隐式请求数据。

图1.1中显示了一条从客户端到Web服务器的单箭头,但实际上从客户端传送到Web服务器的数据有两种,它们分别为用户在表单中输入的显式数据,以及后台的HTTP信息。

两种数据都很重要。

HTTP信息包括cookie、浏览器所能识别的媒体类型和压缩模式等。

(3)生成结果。

这个过程可能需要访问数据库、执行RMI或EJB调用、调用Web服务,或者直接计算得出对应的响应。

实际的数据可能存储在关系型数据库中。

该数据库可能不理解HTTP,或者不能返回HTML形式的结果,所有Web浏览器不能直接与数据库进行会话。

即使它能够做到这一点,为了安全上的考虑,我们也不希望让它这么做。

对应大多数其他应用程序,也存在类似的问题。

因此,我们需要Web中间层从HTTP流中提取输入数据,与应用程序会话,并将结果嵌入到文档中。

(4)向客户发送显式数据(即文档)。

这个文档可以用各种格式发送,包括文本(HTML或XML),二进制(GIF图),甚至可以式建立在其他底层格式之上的压缩格式,如gzip。

但是,到目前为止,HTML 式最常用的格式,故而servelt和JSP的重要任务之一就式将结果包装到HTML中。

(5)发送隐式的HTTP响应数据。

图1.1中显示了一条从Web中间层到客户端的单箭头。

但是,实际发送的数据有两种:文档本身,以及后台的HTTP信息。

同样,两种数据对开发来说都式至关重要的。

HTTP响应数据的发送过程涉及告知浏览器或其他客户程序所返回文档的类型(如HTML),设置cookie和缓存参数,以及其他类似的任务。

1.2动态构建网页的原因预先建立的文档可以满足客户的许多请求,服务器无需调用servlet就可以处理这些请求。

然而,许多情况下静态的结果不能满足要求,我们需要针对每个请求生成一个页面。

实时构建页面的理由有很多种:1、网页基于客户发送的数据。

例如,搜索引擎生成的页面,以及在线商店的订单确认页面,都要针对特定的用户请求而产生。

在没有读取到用户提交的数据之前,我们不知道应该显示什么。

要记住,用户提交两种类型的数据:显示(即HTML表单的数据)和隐式(即HTTP请求的报头)。

两种输入都可用来构建输出页面。

基于cookie值针对具体用户构建页面的情况尤其普遍。

2、页面由频繁改变的数据导出。

如果页面需要根据每个具体的请求做出相应的改变,当然需要在请求发生时构建响应。

但是,如果页面周期性地改变,我们可以用两种方式来处理它:周期性地在服务器上构建新的页面(和客户请求无关),或者仅仅在用户请求该页面时再构建。

具体应该采用哪种方式要根据具体情况而定,但后一种方式常常更为方便,因为它只需简单地等待用户的请求。

例如,天气预报或新闻网站可能会动态地构建页面,也有可能会返回之前构建的页面(如果它还是最新的话)。

3、页面中使用了来自公司数据库或其他数据库断数据源的信息。

如果数据存储在数据库中,那么,即使客户端使用动态Web内容,比如applet,我们依旧需要执行服务器端处理。

想象以下,如果一个搜索引擎网站完全使用applet,那么用户将会看到:“正在下载50TB的applet,请等待!”。

显然,这样很愚蠢;这种情况下,我们需要与数据库进行会话。

从客户端到Web层再到数据库(三层结构),要比从applet直接到数据库(二层结构)更灵活,也更安全,而性能上的损失很少甚至没有。

毕竟数据库调用通常是对速度影响最大的步骤,因而,经过中间层可以执行高速缓存和连接共享。

理论上讲,servelt并非只用于处理HTTP请求的Web服务器或应用服务器,它同样可以用于其他类型的服务器。

例如,servlet能够嵌入到FTP或邮件服务器中,扩展他们的功能。

而且,用于会话启动协议服务器的servlet API最近已经被标准化(参见/en/jsr/detail?id=116)。

但在实践中,servelt的这种用法尚不流行,在此,我们只论述HTTP Servlet。

1.3 Servlet相对于“传统”CGI的优点和传统CGI及许多类CGI技术相比,Java servelt效率更高、更易用、更强大、更容易移植、更安全、也更廉价。

1、效率应用传统的CGI,针对每个HTTP请求都用启动一个新的进程。

如果CGI程序自身相对比较简短,那么启动进程的开销会占用大部分执行时间。

而使用servelt,Java 虚拟机会一直运行,并用轻量级的Java线程处理每个请求,而非重量级的操作系统进程。

类似地,应用传统的CGI技术,如果存在对同一CGI程序的N个请求,那么CGI程序的代码会载入内存N次。

同样的情况,如果使用servlet则启动N个线程,单仅仅载入servlet类的单一副本。

这种方式减少了服务器的内存需求,通过实例化更少的对象从而节省了时间。

最后,当CGI程序结束对请求的处理之后,程序结束。

这种方式难以缓存计算结果,保持数据库连接打开,或是执行依靠持续性数据的其他优化。

然而,servelt会一直停留在内存中(即使请求处理完毕),因而可以直接存储客户请求之间的任意复杂数据。

2、便利Servelt提供大量的基础构造,可以自动分析和解码HTML的表单数据,读取和设置HTTP报头,处理cookie,跟踪会话,以及其他次类高级功能。

而在CGI中,大部分工作都需要我们资金完成。

另外,如果您已经了解了Java编程语言,为什么还有学校Perl呢?您已经承认应用Java技术编写的代码要比Visual Basic,VBScript 或C++编写的代码更可靠,且更易重用,为什么还有倒退回去选择那些语言来开发服务器端的程序呢?3、强大Servlet支持常规CGI难以实现或根本不能实现的几项功能。

Servlet能够直接于Web服务器对话,而常规的CGI程序做不到这一点,至少在不使用服务器专有API 的情况下是这样。

例如,与Web服务器的通信使得讲相对URL转换成具体的路径名变得更为容易。

多个servelt还可以共享数据,从而易于实现数据库连接共享和类似的资源共享优化。

Servelt还能维护请求之间的信息,使得诸如会话跟踪和计算结果缓存等技术变得更为简单。

4、可移植性Servelt使用Java编程语言,并且遵循标准的API。

所有主要的Web服务器。

实际上都直接或通过插件支持servlet。

因此。

为Macromedia JRun编写的servlet,可以不经过任何修改地在Apache Tomcat,Microsoft Internet Information Server,IBM WebSphere 。

iPlanet Enterprise Server。

Oracle9i AS 或者StrNine WebStar 上运行。

他们是java2平台企业版的一部分,所以对servlet的支持越来越普遍。

5、廉价对于开发用的网站、低容量或中等容量网站的部署,有大量免费或极为廉价的Web服务器可供选择。

因此,通过使用servelt和jsp,我们可以从免费或廉价的服务器开始,在项目获得初步成功后,在移植到更高性能或高级管理工具的昂贵的服务器上。

这与其他CGI方案形成鲜明的对比,这些CGI方案在初期都需要为购买专利软件包投入大量的资金。

价格和可移植性在某种程度上是相互关联的。

例如,Marty记录了所有通过电子邮件向他发送问题的读者的所在国。

印度接近列表的顶端,可能仅次于美国。

Marty 曾在马尼拉讲授过jsp和servlet培训课程,那儿对servelt和jsp技术抱很大的兴趣。

那么,为什么印度和菲律宾都对这项技术着呢感兴趣呢?我们推测答案可能分两部分。

首先,这两个国家都拥有大量训练有素的软件开发人员。

其次,这两个国家的货币对美元的汇率都极为不利。

因此,从美国公司那里购买专用Web服务器会消耗掉项目的大部分前期资金。

但是,使用servlet 和JSP,他们能够从免费的服务器开始:Apache Tomcat。

项目取得成功之后,他们可以转移到性能更高、管理更容易,但需要付费的服务器。

他们的servelt和jsp不需要重写编写。

如果他们的项目变得更庞大,他们或许希望转移到分布式环境。

没有问题:他们可以转而使用Macromedia JRun Professional,该服务器支持分布式应用。

同样,他们的servelt和jsp没有任何部分需要重写。

如果项目变得极为庞大,错综复杂,他们或许希望使用Enterprise JavaBeans来封装他们的商业逻辑。

因此,他们可以切换到BEA WebLogic或Oracle9i AS。

同样,不需要对servlet和jsp做出更改。

最后,如果他们的项目变得更庞大,他们或许将他从Linux转移到运行IBM WebSphere的IBM大型机上。

他们还是不需要做出任何更改。

6、安全传统CGI程序中主要的漏洞来源之一就是,CGI程序常常由通过的操作系统外壳来执行。

因此,CGI程序必须仔细地过滤掉那些可能被外壳特殊处理的字符,如反引导和分号。

实现这项预防措施的难度可能超出我们的想象,在广泛应用的CGI库中,不断发现由这类问题引发的弱点。

问题的第二个来源是,一些CGI程序用不自动检查数组和字符串边界的语言编写而成。

例如,在C和C++中,可以分配一个100个元素的数组,然后向第999个“元素“写入数据——实际上是程序内存的随机部分,这完全合法。

因而,如果程序员忘记执行这项检查,就会将系统暴露在蓄意或偶然的缓冲区溢出攻击之下。

Servelt不存在这些问题。

即使servelt执行系统调用激活本地操作系统上的程序,它也不会用到外壳来完成这项任务。

相关文档
最新文档