毕业设计JSP外文翻译

合集下载

毕业设计英文翻译JSP

毕业设计英文翻译JSP

JSP OverviewJSP is the latest Java technology for web application development and is based on the servlet technology introduced in the previous chapter. While servlets are great in many ways, they are generally reserved for programmers. In this chapter, we look at the problems that JSP technology solves, the anatomy of a JSP page, the relationship between servlets and JSP, and how the server processes a JSP page.In any web application, a program on the server processes requests and generates responses. In a simple one-page application, such as an online bulletin board, you don't need to be overly concerned about the design of this piece of code; all logic can be lumped together in a single program. However, when the application grows into something bigger (spanning multiple pages, using external resources such as databases, with more options and support for more types of clients), it's a different story. The way your site is designed is critical to how well it can be adapted to new requirements and continue to evolve. The good news is that JSP technology can be used as an important part in all kinds of web applications, from the simplest to the most complex.Therefore, this chapter also introduces the primary concepts in the design model recommended for web applications and the different roles played by JSP and other Java technologies in this model.The Problem with ServletsIn many Java servlet-based applications, processing the request and generating the response are both handled by a single servlet class. shows how a servlet class often looks.Example 3-1. A typical servlet classpublic class OrderServlet extends HttpServlet {public void doGet((HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException {("text/html");PrintWriter out = ( );if (isOrderInfoValid(request)) {saveOrderInfo(request);("<html>");(" <head>");(" <title>Order Confirmation</title>");(" </head>");(" <body>");(" <h1>Order Confirmation</h1>");renderOrderInfo(request);(" </body>");("</html>");}...If you're not a programmer, don't worry about all the details in this code. The point is that the servlet contains request processing and business logic (implemented by methods such as isOrderInfoValid() and saveOrderInfo( )), and also generates the response HTML code, embedded directly in the servlet code using println( ) calls. A more structured servlet application isolates different pieces of the processing in various reusable utility classes and may also use a separate class library for generating the actual HTML elements in the response. Even so, the pure servlet-based approach still has a few problems:Thorough Java programming knowledge is needed to develop and maintain all aspects of the application, since the processing code and the HTML elements are lumped together.Changing the look and feel of the application, or adding support for a new type of client (such as a WML client), requires the servlet code to be updated and recompiled.It's hard to take advantage of web page development tools when designing the application interface. If such tools are used to develop the web page layout, the generated HTML must then be manually embedded into the servlet code, a process which is time consuming, error prone, and extremely boring.Adding JSP to the puzzle lets you solve these problems by separating the request processing and business logic code from the presentation, as illustrated in . Instead of embedding HTML in the code, place all static HTML in a JSP page, just as in a regular web page, and add a few JSP elements to generate the dynamic parts of the page. The request processing can remain the domain of the servlet, and the business logic can be handled by JavaBeans and EJB components.Figure 3-1. Separation of request processing, business logic, and presentationAs I mentioned before, separating the request processing and business logic frompresentation makes it possible to divide the development tasks among people with different skills. Java programmers implement the request processing and business logic pieces, web page authors implement the user interface, and both groups can use best-of-breed development tools for the task at hand. The result is a much more productive development process. It also makes it possible to change different aspects of the application independently, such as changing the business rules without touching the user interface.This model has clear benefits even for a web page author without programming skills, working alone. A page author can develop web applications with many dynamic features, usingthe JSP standard actions and the JSTL libraries, as well as Java components provided by open source projects and commercial companies.JSP ProcessingJust as a web server needs a servlet container to provide an interface to servlets, the server needs a JSP container to process JSP pages. The JSP container is responsible for intercepting requests for JSP pages. To process all JSP elements in the page, the container first turns the JSP page into a servlet (known as the JSP page implementation class). The conversion is pretty straightforward; all template text is converted to println( ) statements similar to the ones in the handcoded servlet shown in , and all JSP elements are converted to Java code that implements the corresponding dynamic behavior. The container then compiles the servlet class.Converting the JSP page to a servlet and compiling the servlet form the translation phase. The JSP container initiates the translation phase for a page automatically when it receives the first request for the page. Since the translation phase takes a bit of time, the first user to request a JSP page notices a slight delay. The translation phase can also be initiated explicitly; this is referred to as precompilation of a JSP page. Precompiling a JSP page is a way to avoid hitting the first user with this delay. It is discussed in more detail in .The JSP container is also responsible for invoking the JSP page implementation class (the generated servlet) to process each request and generate the response. This is called the request processing phase. The two phases are illustrated in .Figure 3-2. JSP page translation and processing phasesAs long as the JSP page remains unchanged, any subsequent request goes straight to the request processing phase ., the container simply executes the class file). When the JSP page is modified, it goes through the translation phase again before entering the request processing phase.The JSP container is often implemented as a servlet configured to handle all requests for JSP pages. In fact, these two containers—a servlet container and a JSP container—are often combined in one package under the name web container.So in a way, a JSP page is really just another way to write a servlet without having to be a Java programming wiz. Except for the translation phase, a JSP page is handled exactly like a regular servlet; it's loaded once and called repeatedly, until the server is shut down. By virtue of being an automatically generated servlet, a JSP page inherits all the advantages of a servlet described in : platform and vendor independence, integration, efficiency, scalability, robustness, and security.JSP ElementsThere are three types of JSP elements you can use: directive, action, and scripting. A new construct added in JSP is an Expression Language (EL) expression; let's call this a forth element type, even though it's a bit different than the other three.Directive elementsThe directive elements, shown in , specify information about the page itself that remains the same between requests—for example, if session tracking is required or not, buffering requirements,Table 3-1. Directive elementscomponentsJSP elements, such as action and scripting elements, are often used to work with JavaBeans components. Put succinctly, a JavaBeans component is a Java class that complies with certain coding conventions. JavaBeans components are typically used as containers for information that describes application entities, such as a customer or an order.JSP Application Design with MVCJSP technology can play a part in everything from the simplest web application, such as an online phone list or an employee vacation planner, to complex enterprise applications, such as a human resource application or a sophisticated online shopping site. How large a part JSP plays MVC was first described by Xerox in a number of papers published in the late 1980s. The key differs in each case, of course. In this section, I introduce a design model called Model-View-Controller (MVC), suitable for logic into three distinct units: the Model, the View, and the Controller. In a server application, we commonly classify the parts of the application as business logic, presentation, and request processing. Business logic is the term used for the manipulation of an application's data, such as customer, product, and order information. Presentation refers to how the application data is displayed to the user, for example, position, font, and size. And finally, request processing is what ties the business logic and presentation parts together. In MVC terms, the Model corresponds to business logic and data, the View to the presentation, and the Controller to the request processing.Why use this design with JSP? The answer lies primarily in the first two elements. Remember that an application data structure and logic (the Model) is typically the most stable part of an application, while the presentation of that data (the View) changes fairly often. Just look at all the face-lifts many web sites go through to keep up with the latest fashion in web design. Yet, the data they present remains the same. Another common example of why presentation should be separated from the business logic is that you may want to present the data in different languages or present different subsets of the data to internal and external users. Access to the data through new types of devices, such as cell phones and personal digital assistants (PDAs), is the latest trend. Each client type requires its own presentation format. It should come as no surprise, then, that separating business logic from the presentation makes it easier to evolve an application as the requirements change; new presentation interfaces can be developed without touching the business logic.This MVC model is used for most of the examples in this book. In Part II, JSP pages are used as both the Controller and the View, and JavaBeans components are used as the Model. The examples in Chapter 5 through Chapter 9 use a single JSP page that handles everything, while Chapter 10 through Chapter 14 show how you can use separate pages for the Controller and the View to make the application easier to maintain. Many types of real-world applications can be developed this way, but what's more important is that this approach allows you to examine all the JSP features without getting distracted by other technologies. In Part III, we look at other possible role assignments when JSP is combined with servlets and Enterprise JavaBeans.JSP 概览JSP是一种用于Web应用程序开发的最新的Java技术,它是成立在servlet 技术基础之上的。

Servlet和JSP文献翻译外文文献

Servlet和JSP文献翻译外文文献

毕业设计(论文)外文Servlet和JSP文献翻译附件1:外文资料翻译译文Servlet和JSP技术简述Nagle and Wiegley,Aug. 2020,953 – 958.摘要:Servlet程序在效劳器端运行,动态地生成Web页面与传统的CGI和许多其他类似CGI的技术相较,Java Servlet具有更高的效率,更易利用,功能更壮大,具有更好的可移植性,更节省投资。

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

Servlet的工作是执行西门的任务,如下图。

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

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

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

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

图中显示了一条从客户端到Web效劳器的单箭头,但事实上从客户端传送到Web效劳器的数据有两种,它们别离为用户在表单中输入的显式数据,和后台的HTTP信息。

两种数据都很重要。

HTTP信息包括cookie、阅读器所能识别的媒体类型和紧缩模式等。

(3)生成结果。

那个进程可能需要访问数据库、执行RMI或EJB挪用、挪用Web效劳,或直接计算得出对应的响应。

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

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

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

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

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

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

那个文档能够用各类格式发送,包括文本(HTML或XML),二进制(GIF图),乃至能够式成立在其他底层格式之上的紧缩格式,如gzip。

毕业设计JSPmvc外文翻译

毕业设计JSPmvc外文翻译

Struts——一种开源MVC的实现这篇文章介绍 Struts,一个使用 servlet 和 JavaServer Pages 技术的一种 Model-View-Controller 的实现。

Struts 可以帮助你控制 Web 项目中的变化并提高专业化。

即使你可能永远不会用 Struts实现一个系统,你可以获得一些想法用于你未来的 servlet 和 JSP 网页的实现中。

简介在小学校园里的小孩子们都可以在因特网上发布 HTML 网页。

然而,有一个重大的不同在一个小学生和一个专业人士开发的之间。

网页设计师(或者 HTML开发人员)必须理解颜色、用户、生产流程、网页布局、浏览器兼容性、图像创建、JavaScript 等等。

设计漂亮的需要做大量的工作,大多数 Java 开发人员更注重创建优美的对象接口,而不是用户界面。

JavaServer Pages (JSP) 技术为网页设计人员和 Java 开发人员提供了一种联系钮带。

如果你开发过大型 Web 应用程序,你就理解“变化”这个词语。

“模型-视图-控制器”(MVC) 就是用来帮助你控制变化的一种设计模式。

MVC 减弱了业务逻辑接口和数据接口之间的耦合。

Struts 是一种 MVC 实现,它将 Servlet 2.2 和 JSP 1.1 标记(属于 J2EE 规)用作实现的一部分。

你可能永远不会用 Struts 实现一个系统,但了解一下 Struts 或许使你能将其中的一些思想用于你以后的 Servlet 和 JSP 实现中。

模型-视图-控制器 (MVC)JSP标签只解决了我们问题中的一部分。

我们依然有验证、流控制、以及更新应用程序结构的问题。

这就是MVC从哪儿来以及来干嘛的。

MVC通过把问题分成三类来帮助解决一些与单模块相关的问题:?Model(模型)模块包括应用程序功能的核心。

模型封装着应用程序的各个结构。

有时它所包含的唯一功能就是结构。

它对于视图或者控制器一无所知。

jsp技术网站设计外文翻译(适用于毕业论文外文翻译+中英文对照)

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 / doPos t / 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开发服务器端应用的主要技术,是开发商务应用表示端的标准。

JSP及其WEB技术毕业设计论文中英文资料对照外文翻译文献

JSP及其WEB技术毕业设计论文中英文资料对照外文翻译文献

中英文资料对照外文翻译文献JSP及其WEB技术. 1 JSP简介JSP(JavaServer Pages)是一种基于Java的脚本技术。

是由Sun Microsystems 公司倡导、许多公司参与一起建立的一种动态网页技术标准。

JSP技术有点类似ASP 技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。

用JSP开发的Web应用是跨平台的,即能在Linux下运行,也能在其他操作系统上运行。

在JSP 的众多优点之中,其中之一是它能将 HTML 编码从 Web 页面的业务逻辑中有效地分离出来。

用 JSP 访问可重用的组件,如 Servlet、JavaBean 和基于 Java 的 Web 应用程序。

JSP 还支持在Web 页面中直接嵌入 Java 代码。

可用两种方法访问 JSP 文件:浏览器发送 JSP 文件请求、发送至 Servlet 的请求。

JSP技术使用Java编程语言编写类XML的tags 和scriptlets,来封装产生动态网页的处理逻辑。

网页还能通过tags和scriptlets 访问存在于服务端的资源的应用逻辑。

JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。

Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。

插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。

JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。

JSP页面由HTML代码和嵌入其中的Java代码所组成。

服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。

网页设计专业毕业设计外文翻译

网页设计专业毕业设计外文翻译

Produce the design of the tool and realize automaticallyon the basis of JSP webpageIt is an important respect that Internet uses that Web develops technology, and JSP is the most advanced technology that Web is developed , it is present Web developer's first-selected technology. But because JSP has relatively high expectations for Web developer, a lot of general Web developers can not use this advanced technology . The discussion produces the design of the tool and realizes automatically on the basis of JSP webpage of the template and label storehouse, put forward concrete design philosophy and implementation method .With the popularization of WWW (World Wide Web ), the technology of the dynamic webpage is developed rapidly too. From original CGI (Common Gateway In-terface ) to ASP (Active Server Page ), have met the webpage developer to the demand for developing technology of the dynamic webpage to a certain extent. But no matter CGI or ASP have certain limitation, for instance, consuming to resources of the server of CGI, ASP can only be used etc. with Microsoft IIS, all these have limited scope of application of the technology, have hindered their popularization greatly. The vast page developers all look forward to a kind of unified page and develop technology earnestly, characteristic that this technology there should be:①Have nothing to do with the operating platform, can run on any Web or the application program server ;②Show the logic and page of application program that separates ; ③Offer codes to put in an position, simplify and develop the course based on interactive application program of Web.JSP (Java Server Page ) technology is designed and used for responding to the request that like this. JSP is developed technology by the new webpage that Sun MicroSystem Company put out in June of 1999, it is that Web based on Java Serv-let and the whole Java system develops technology, and Servlet2. Expansion of 1API. Utilize this technology, can set up advancedly , safely and stepping dynamic websites of the platform .Java is the future mainstream to develop technology , have a lot of advantages . JSP is Java important application technology on Internet/Intranet Web , get extensive support and admit, it can conbine with various kinds of Java technology together intactly , thus realize very complicated application.As a kind of technology of development based on text , taking showing as centre, JSP has offered all advantages of Java Servlet. Logic function in order to make sure and showing the function was separated , JSP can already work with JavaBeans , Enterprise JavaBeans (EJB ) and Servlet . The developer of JSP can finish the work that majority and website's logic are correlated with through using JavaBeans , EJB and Servlet , and only assign the work shown to JSP page to finish. Content and show advantage that logic separate lie in , upgrade person , page of appearanceneedn't understand Java code , the personnel upgrading Javas needn't be experts who design webpage either. This can define Web template in JSP page with Javas , in order to set up websites made up of a page with similar appearance. Java completion data offer, have Java code among template, this mean template these can write by one HTML person is it maintain to come.JSP develops technology as the webpage of the mainstream at present, has the following characteristics:(1) Separate the formulation and showing of the content : Using JSP technology, the page developer of Web can use HTML or XML identification to design and format the final page . Use JSP identification or bound foot turn into dynamic content of page actually (whether content according to is it come change to ask). Produce logic of content of the identification and JavaBeans package , truss up of the little script encapsulation, all scripts run in the end of the server. If key logic among identification and JavaBeans, then other people, such as Web administrative staff and page designer encapsulation, can edit and use JSP page , and does not influence the formulation of the content .(2) Emphasize the reusable package : Most JSP pages depend on the reusable one, the package stepping the platform finish more complicated treatment with required application program. Benefitting from the independence of operating platform of Java, the developer can be very convenient to share and exchange and carry out the ordinary package that operated, or make these packages used by more users. The method based on package has accelerated the total development course, the efficiency of improving the project and developing wholly greatly.Though JSP is powerful, it requires the webpage developer should be quite familiar with Java. There are still relatively few Java programmers now, for general webpage developer, the grammar of JSP is more difficult to grasp . So, need a kind of webpage developing instrument and offer commonly used JSP application to general webpage developer, is it understand general page develop developer of technology (HTML ) can use strong function of JSP too only to let.Systematic design object and main technology of use:(1)Design objectSystem this design object for understand but HTML understand general webpage developer of JSP offer a webpage developing instrument at all only, enable them to follow the systematic file, use the daily function of JSP through the label, produce one finally and only include static HTML and dynamic JSP webpage of JSP label.(2)Main technologyThis system is in the design, consider using the technology of the template and JSP label to realize mainly.1、Technology of the templateThe technology of the template is widely applied to various kinds of development and application system. It produces some commonly used frame structure in advance , uses the family to choose the template from the template storehouse conveniently according to the needs of one's own one, is it is it put up to go again by oneself to need , save construction period in user , facilitate use of user. In this system , classify the page according to the function type , sum up the commonly used page type, produce the template storehouse.2、Storehouse technology of the labelIn JSP, movements can create and visit the language target of the procedure and influence the element exported and flowed. JSP has defined six standard movements. Except six standard movement these, user can define own movement finish the specific function. These movements are known as the customer movement, they are the reusable procedure module . Through movement these, programmer can some encapsulation stand up too display function of page in JSP page, make the whole page more succinct and easier to maintain. In a JSP page, movements were transfered through the customer label in these customers. And the label storehouse (Tag Library ) is the set of the customer label.JSP label storehouse is that one kind produces the method based on script of XML through JavaBeans. It is one of the greatest characteristics of JSP. Through the label storehouse , can expand JSP application unrestrictedly , finish any complicated application demand.JSP label storehouse has the following characteristic:①Easy to use: The labels in JSP and general HTML marks are totally the same in appearance, it is as convenient as ordinary HTML mark to use.②The easy code is paid most attention to: Every label in the label storehouse can finish certain function . Define ready to eat one label storehouse , is it pack one Jar file the label storehouse to need only, then only need use this label storehouse in other systems afterwards, needn't develop codes again , has raised the system and developed efficiency greatly, have reduced the development cost.③The easy code is safeguarded: All application logic is encapsulated in label processor and JavaBeans, all labels concentrate on a label storehouse. If need to upgrade codes or need to revise the function on a webpage, only need to revise the corresponding label. Maintain way in unison through this kind , it is unnecessary in each webpage is it is it fix to act as to get onning, have reduce the work load safeguarded greatly, has economized the cost of safeguarding.④The easy system is expanded : If need to add the new function to the system , only need to define a new label to finish this function, do not need to do any change to other respects of thesystem. Can inherit JSP normal characteristics of various fields in the label storehouse. Can expand and increase the function of JSP unrestrictedly like this, and does not need to wait for the appearance of the next edition JSP .Systematic composition and realizing:(1)The system making upThis system is made up of four parts mainly:1、The database joins some: This system supports several daily databases , including Oracle, Sybase, MSSQLServer, MySQL and DB2, use JDBC and database to link to each other according to database type and database name , user name , password that users offer that users choose.2、The basic form of system produces some: After joining with the database , produce the basic form TC-Tables and TC-Columns of two systems according to the user name linking to each other with the database , TC-Tables form includes English name , Chinese name and some attribute of form belonging to this user in this database , for instance can revise , can inquire about ; The Chinese and English name of the row and some other attribute that TC-Columns form includes belonging to all forms of this user's in this database . For instance can show , can inquire about . Basic information of the database that these basic forms of two systems provide to user's institute for use in the course of development of the whole system.3、The template is chosen to produce some with the webpage: This part is a key part of a system. It includes two pieces of sub module .①The template is chosen some: The system offers the template to user and chooses the interface, let users choose the templates used from the template storehouse according to the need.②The template is dealt with some: According to template that user choose, system transfer designated template deal with module is it punish to go on to these template. When dealing with the label that the procedure meets in the template, offer the mutual interface to user, let user input parameter for designated label , prove system validity of label that user input. Finished the formulation of JSP page systematically finally.Webpage preview is with revising some: After the webpage was produced out, the system has offered a webpage preview window and code to user and looked over that revises the window. Through this preview window, users can look at the result of JSP page produced out in advance . If user static result of respect in page very satisfied, user can through code look over revise window revise HTML code of code. If users have further demands for the static result of the page, the system has also offered a piece of interface which transfers DreamWeaver editing machine to user, users can use it to carry on further modification and perfection to the static result of JSP page that is produced out .(2)Systematic realization1、Realization of the template storehouse and label storehouseThe planning and design of the label storehouse are essential in the whole system design, efficiency that the degree and system that are put in an position have operated that its relation has reached codes. Its planning should follow the following principle .(1) Should try one's best little including static HTML among label. To general user, the label is transparent. Users can not look over and revise labels . If include too many static HT-ML sentence in the label , will influence the modification and perfection of user's static result to the page, limit the use of the label.(2) Try one's best to raise the paying most attention to degree of the code. Is it is it is it is it is it is it get to JSP public JSP out to withdraw to use to try one's best to classify to go on to use, form labels. Do not use and realize this application repeatedly in each label . While revising and perfecting to using like this , only need to revise this label, maintenance of the easy code.(3) Facilitate users' use. While designing the label storehouse , should fully consider users' operating position , it can very easy and understanding and using labels conveniently to use the family.①Definition of the label storehouse: Define a label storehouse, must define a label storehouse and describe the file (TLD ) at first . This is a file of script based on XML, have defined the edition of XML in this file , codes used, the edition , name and definition and parameter of all labels included in this storehouse of the label storehouse of the edition of the label storehouse , JSP used describe, including the name of the label, corresponding Javas of label, description information of the label ,etc..②Realization of the label: One label first special Java type, this each must inherit TagSupports , this each is in javax. servlet. jsp. Define in tagext bag . In the labels, the parameter which includes this label initializes the subject treatment method (Handler ) of method (Set/Get ) , label and method available for making the first class label to adjust,etc..③Realization of the template : A template is that one contains JSP file that labels quoted . In order to quote the labels defined in the template , must introduce the label storehouse at first .<%@taglib uri=“tag.tld”prefix=“ctag”%>Among them uri appoints the label storehouse to describe the route of the file ; Prefixes used when prefix appoints to quote labels.While quoting the designated label in the template , use the designated prefix while introducing the label storehouse, appoint the name of the label; It is the parameter assignment of the label.2、Systematic development environmentWhat this systematic subject procedure making is used is JBuilder 6 of Borland Company. 0, it is Front-Page2000 of Microsoft Company that the template is developed and used, what the label storehouse is developed and used is UltraEdit editing machine, what JDK is adopted is JDK1.4. The system testing environment is JRun3. 0.Java future mainstream to develop language, and Java using JSP will become major technology that Web will be developed in the future too mainly at Web. This system has adopted the label storehouse , one of the biggest characteristics of JSP, enable the general Web developer to use JSP strong dynamic page function conveniently too, develop JSP dynamic Web page of the modern techniques. Because this system adopts Java to develop, can run under the operating system of any support graphic interface , have realized complete having nothing to do with the platform. This system is easy to expand and perfect. Can consider offering the interface to user afterwards , will use the family to expand the template storehouse and label storehouse by oneself, strengthen the systematic function further.List of references:[1] Cay S. Horstmann,Gary Cornell. Java 2 key technology (CoreJava 2 ) [M ]. Beijing: Publishing house of the mechanical industry.[2] Bruce Eckel. Java programming thought (Thinking in Java ) [M ]. Beijing: Publishing house of the mechanical industry.[3] Joseph L. Weber. Java 2 programming is explained in detail (Using Java 2) [M ]. Beijing: Electronic Industry Press.[4] Borland Company. Building Applications with JBuilder.基于JSP网页自动生成工具的设计与实现Web开发技术是Internet应用的一个重要方面,而JSP又是Web开发的最先进的技术,是当前Web开发人员的首选技术。

JAVA毕业设计外文文献翻译

JAVA毕业设计外文文献翻译

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 JS P( 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 Webapplication that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on themarket 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 GENER ALIZEThe 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 appropriatein 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 youchoose.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 apGFDGpropriate tool for the job, and servlets, by themselves, do not completeyour 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 changesaccording 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 neednot 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 progress to 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 ownpurposes. 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 theaforementioned 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 alsoallows 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 the expression 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 andefficiently. 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 Webapplication procedure very expediently.JSP的技术发展历史作者:Kathy Sierra and Bert Bates来源:Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。

jsp网上商城系统毕业设计答辩外文文献及译文

jsp网上商城系统毕业设计答辩外文文献及译文

毕业设计说明书英文文献及中文翻译学生姓名:学号:学院:专业:指导教师:Struts——an open-source MVC implementationBy: Malcolm Davis.Source: Struts--an open-source MVC implementation[J].IBM Systems JournalThis article introduces Struts, a Model-View-Controller implementation that uses servlets and JavaServer Pages (JSP) technology. Struts can help you control change in your Web project and promote specialization. Even if you never implement a system with Struts,you may get some ideas for your future servlets and JSP page implementation.IntroductionKids in grade school put HTML pages on the Internet. However, there is a monumental difference between a grade school page and a professionally developed Web site. The page designer (or HTML developer) must understand colors, the customer, product flow, page layout, browser compatibility, image creation, JavaScript, and more. Putting a great looking site together takes a lot of work, and most Java developers are more interested in creating agreat looking object interface than a user interface. Java Server Pages (JSP) technology provides the glue between the page designer and the Java developer.If you have worked on a large-scale Web application, you understand the term change.Model-View-Controller (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. Struts is an MVC implementation that uses Servlets 2.2 and JSP 1.1 tags, from the J2EE specifications, as part of the implementation. Y ou may never implement a system with Struts, but looking at Struts may give you some ideas on your future Servlets and JSP implementations.Model-View-Controller (MVC)JSP tags solved only part of our problem. We still have issues with validation, flow control, and updating the state of the application. This is where MVC comes to the rescue.MVC helps resolve some of the issues with the single module approach by dividing theproblem into three categories:• ModelThe model contains the core of the application's functionality. The model encapsulates thestate of the application. Sometimes the only functionality it contains is state. It knows nothing about the view or controller.• View• The view provides the presentation of the model. It is the look of the application. The view can access the model getters, but it has no knowledge of the setters. In addition, it knows nothing about the controller. The view should be notified when changes to the model occur. ControllerThe controller reacts to the user input. It creates and sets the model.MVC Model 2The Web brought some unique challenges to software developers, most notably the stateless connection between the client and the server. This stateless behavior made it difficult for the model to notify the view of changes. On the Web, the browser has to re-query the server to discover modification to the state of the application.Another noticeable change is that the view uses different technology for implementation than the model or controller. Of course, we could use Java (or PERL, C/C++ or what ever) code to generate HTML. There are several disadvantages to that approach:• Java programmers should develop services, not HTML.• Changes to layout would require changes to code.• Customers of the service should be able to create pages to meet their specific needs.• The page designer isn't able to have direct involvement in page development.• HTML embedded into code is ugly.For the Web, the classical form of MVC needed to change.MVC Model 2 Struts, an MVC 2 implementation Struts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. This definition implies that Struts is a framework, rather than a library, but Struts also contains an extensive tag library and utility classes that work independently of the framework.• Client browserAn HTTP request from the client browser creates an event. The Web container will respond with an HTTP response.• ControllerThe Controller receives the request from the browser, and makes the decision where to send the request. With Struts, the Controller is a command design pattern implemented as a servlet. The struts-config.xml file configures the Controller.• Business logicThe business logic updates the state of the model and helps control the flow of the application.With Struts this is done with an Action class as a thin wrapper to the actual business logic.• Model stateThe model represents the state of the application. The business objects update the application state. ActionForm bean represents the Model state at a session or request level, and not at a persistent level. The JSP file reads information from the ActionForm bean using JSP tags.• ViewThe view is simply a JSP file. There is no flow logic, no business logic, and no model information -- just tags. Tags are one of the things that make Struts unique compared to other frameworks like V elocity.Struts detailsDisplayed in Figure 6 is a stripped-down UML diagram of the org.apache.struts.action package and shows the minimal relationships among ActionServlet (Controller), ActionForm (Form State), and Action (Model Wrapper).The ActionServlet classDo you remember the days of function mappings? Y ou would map some input event to a ointer to a function. If you where slick, you would place the configuration information into ale and load the file at run time. Function pointer arrays were the good old days of structured rogramming in C.Life is better now that we have Java technology, XML, J2EE, and all that. The Struts ontroller is a servlet that maps events (an event generally being an HTTP post) to classes. guess what -- the Controller uses a configuration file so you don_t have to hard-code the alues. Life changes, but stays the same.ActionServlet is the Command part of the MVC implementation and is the core of the ramework. ActionServlet (Command) creates and uses Action, an ActionForm, and ctionForward. As mentioned earlier, the struts-config.xml file configures the command. uring the creation of the Web project, Action and ActionForm are extended to solve the pecific problem space. The file struts-config.xml instructs ActionServlet on how to use the xtended classes. There are several advantages to this approach:• The entire logical flow of the application is in a hierarchical text file. This makes itasier to view and understand, especially with large applications.• The page designer does not have to wade through Java code to understand the flow of e application.• The Java developer does not need to recompile code when making flow changes. Command functionality can be added by extending ActionServlet.The ActionForm classActionForm maintains the session state for the Web application. ActionForm is anbstract class that is sub-classed for each input form model. When I say input form model, Im saying ActionForm represents a general concept of data that is set or updated by a HTML form. For instance, you may have a UserActionForm that is set by an HTML Form. The Struts framework will:• Check to see if a UserActionForm exists; if not, it will create an instance of the class.• Struts will set the state of the UserActionForm using corresponding fields from the HttpServletRequest. No more dreadful request.getParameter() calls. For instance, the Struts framework will take fname from request stream and call UserActionForm.setFname().• The Struts framework updates the state of the UserActionForm before passing it to the business wrapper UserAction.• Before passing it to the Action class, Struts will also conduct form state validation by calling the validation() method on UserActionForm. Note: This is not always wise to do. There might be ways of using UserActionForm in other pages or business objects, where the validation might be different. V alidation of the state might be better in the UserAction class.• The UserActionForm can be maintained at a session level.Notes:• The struts-config.xml file controls which HTML form request maps to which ActionForm. • Multiple requests can be mapped UserActionForm.• UserActionForm can be mapped over multiple pages for things such as wizards.The Action classThe Action class is a wrapper around the business logic. The purpose of Action class is to translate the HttpServletRequest to the business logic. To use Action, subclass and overwrite the process() method.The ActionServlet (Command) passes the parameterized classes to ActionForm using the perform() method. Again, no more dreadful request.getParameter() calls. By the time the event gets here, the input form data (or HTML form data) has already been translated out of the request stream and into an ActionForm class.Note: "Think thin" when extending the Action class. The Action class should control the flow and not the logic of the application. By placing the business logic in a separate package or EJB, we allow flexibility and reuse.Another way of thinking about Action class is as the Adapter design pattern. The purpose of the Action is to "Convert the interface of a class into another interface the clients expect. Adapter lets classes work together that couldn_t otherwise because of incompatibility interface" (from Design Patterns - Elements of Reusable OO Software by Gof). The client in this instance is the ActionServlet that knows nothing about our specific business class interface. Therefore, Struts provides a business interface it does understand, Action. By extending the Action, we make our business interface compatible with Struts business interface. (An interesting observation is that Action is a class and not an interface. Action started as an interface and changed into a class over time. Nothing's perfect.)The Error classesThe UML diagram (Figure 6) also included ActionError and ActionErrors. ActionError encapsulates an individual error message. ActionErrors is a container of ActionError classes that the View can access using tags. ActionErrors is Struts way of keeping up with a list of errors.UML diagram of the relationship of the Command (ActionServlet) to the Model (Action) The ActionMapping classAn incoming event is normally in the form of an HTTP request, which the servlet Container turns into an HttpServletRequest. The Controller looks at the incoming event and dispatches the request to an Action class. The struts-config.xml determines what Action class the Controller calls. The struts-config.xml configuration information is translated into a set of ActionMapping, which are put into container of ActionMappings. (If you have not noticed it, classes that end with s are containers) The ActionMapping contains the knowledge of how a specific event maps to specific Actions. The ActionServlet (Command) passes the ActionMapping to the Action class via the perform() method. This allows Action to access the information to control flow.ActionMappingsActionMappings is a collection of ActionMapping objects.Struts pros Use of JSP tag mechanism The tag feature promotes reusable code and abstracts Java code from the JSP file. This feature allows nice integration into JSP-based development tools that allow authoring with tags.• Tag libraryWhy re-invent the wheel, or a tag library? If you cannot find something you need in the library, contribute. In addition, Struts provides a starting point if you are learning JSP tag technology.• Open sourceY ou have all the advantages of open source, such as being able to see the code and having everyone else using the library reviewing the code. Many eyes make for great code review.• Sample MVC implementationStruts offers some insight if you want to create your own MVC implementation.• Manage the problem spaceDivide and conquer is a nice way of solving the problem and making the problem manageable.中北大学2014届毕业设计英文文献译文Struts 一个开源的MVC实现作者:马尔科姆·戴维斯。

计算机专业毕业设计外文翻译--JSP内置对象

计算机专业毕业设计外文翻译--JSP内置对象

附录1 外文参考文献(译文)JSP内置对象有些对象不用声明就可以在JSP页面的Java程序片和表达式部分使用,这就是JSP 的内置对象。

JSP的内置对象有:request、response、session、application、out.response和request对象是JSP内置对象中较重要的两个,这两个对象提供了对服务器和浏览器通信方法的控制。

直接讨论这两个对象前,要先对HTTP协议—Word Wide Wed底层协议做简单介绍。

Word Wide Wed是怎样运行的呢?在浏览器上键入一个正确的网址后,若一切顺利,网页就出现了。

使用浏览器从网站获取HTML页面时,实际在使用超文本传输协议。

HTTP规定了信息在Internet上的传输方法,特别是规定吧浏览器与服务器的交互方法。

从网站获取页面时,浏览器在网站上打开了一个对网络服务器的连接,并发出请求。

服务器收到请求后回应,所以HTTP协议的核心就是“请求和响应”。

一个典型的请求通常包含许多头,称作请求的HTTP头。

头提供了关于信息体的附加信息及请求的来源。

其中有些头是标准的,有些和特定的浏览器有关。

一个请求还可能包含信息体,例如,信息体可包含HTML表单的内容。

在HTML表单上单击Submit 键时,该表单使用ACTION=”POST”或ACTION=”GET”方法,输入表单的内容都被发送到服务器上。

该表单内容就由POST方法或GET方法在请求的信息体中发送。

服务器发送请求时,返回HTTP响应。

响应也有某种结构,每个响应都由状态行开始,可以包含几个头及可能的信息体,称为响应的HTTP头和响应信息体,这些头和信息体由服务器发送给客户的浏览器,信息体就是客户请求的网页的运行结果,对于JSP 页面,就是网页的静态信息。

用户可能已经熟悉状态行,状态行说明了正在使用的协议、状态代码及文本信息。

例如,若服务器请求出错,则状态行返回错误及对错误描述,比如HTTP/1.1 404 Object Not Found。

外文文献-JSP Technology Conspectus And Specialties

外文文献-JSP Technology Conspectus And Specialties

外文文献-JSP Technology Conspectus And Specialties 毕业设计外文文献原文及译文学生姓名: 学号:电子与计算机科学技术系系别:网络工程专业:指导教师:2015年 5 月中北大学信息商务学院2015届毕业设计外文文献原文及译文JSP Technology Conspectus And SpecialtiesThe JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develop dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programming languages, in a short span of a few years, has formed a complete set of standards, and widely used in electronic commerce, etc. In China, the JSP now also got more extensive attention, get a good development, more and more dynamic website to JSP technology. Therelated technologies of JSP are briefly introduced.The JSP a simple technology can quickly and with the method of generating Web pages. Use the JSP technology Web page can be easily display dynamic content. The JSP technology are designed to make the construction based on Web applications easier and efficient, and these applications and various Web server, application server, the browser and development tools work together.The JSP technology isn't the only dynamic web technology, also not the first one, in the JSP technology existed before the emergence of several excellent dynamic web technology, such as CGI, ASP, etc. With the introduction of these technologies under dynamic web technology, the development and the JSP. TechnicalJSP the development background and development historyIn web brief history, from a world wide web that most of the network information static on stock transactions evolution to acquisition of an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions.Based on the browser client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extremely simplified application deployment and management (to update an application, management personnel only need to change the program on a server, not thousands of installation in client applications). So, the software industry is rapidly to build on the client browser multi-layer application.The rapid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challenge is to create the interaction based on Web applications, in these procedures, the content of a Web page is based on the user's request or the state of the system, and are not predefined characters.For the problem of an early solution is to use a CGI - BIN interface. Developers write to第 1 页共 19 页中北大学信息商务学院2015届毕业设计外文文献原文及译文interface with the relevant procedures and separate based on Web applications, the latter through the Web server to invoke the former. This plan has serious problem -- each new extensible CGI requirements in a new process on the server. If multiple concurrent users access to this procedure, these processes will use the Web server of all available resources, and the performance of the system will be reduced toextremely low.Some Web server providers have to provide for their server byplugins "and" the API to simplify the Web application development. These solutions are associated with certain Web server, cannot solve the span multiple suppliers solutions. For example, Microsoft's Active Server mix (ASP) technology in the Web page to create dynamic content more easily, but also can work in Microsoft on Personal Web Server and IIS.There are other solutions, but cannot make an ordinary pagedesigners can easily master. For example, such as the Servlet Java technologies can use Java language interaction application server code easier. Developers to write such Servlet to receive signals from the Web browser to generate an HTTP request, a dynamic response (may be inquires the database to finish the request), then send contain HTML or XML documents to the response of the browser.note: one is based on a Java Servlet Java technical operation in the server program (with different, the latter operating in the Applet browser end). In this book the Servlet chapter 4.Using this method, the entire page must have made in Java Servlet.If developers or Web managers want to adjust page, you'll have to edit and recompile the Servlet Java, even in logic has been able to run. Using this method, the dynamic content with the application of the page still need to develop skills.Obviously, what is needed is a industry to create dynamic content within the scope of the pages of the solution. This program will solve the current scheme are limited. As follows:can on any Web server or applications.will application page displays and separation.can rapidly developing and testing.simplify the interactive development based on Web application process.The JSP technology is designed to meet such requirements. The JSP specification is a Web server, application server, trading system and develop extensive cooperation between the tool suppliers. From this standard to develop the existing integration and balance of Java programming environment (for example, Java Servlet and JavaBeans) support techniques and tools. The result is a kind of new and developing method based on Web applications, using第 2 页共 19 页中北大学信息商务学院2015届毕业设计外文文献原文及译文component-based application logic page designers with powerful functions.Overall Semantics of a JSP PageA JSP page implementation class defines a _jspService() method mapping from the request to the response object. Some details of this transformation are specific to the scripting language used (see Chapter JSP.9, “Scripting”). Most details are not language specific and are described in this chapter.The content of a JSP page is devoted largely to describing the data that is written into the output stream of the response. (The JSP container usually sends this data back to the client.) The description is based on a JspWriter object that is exposed through the implicit object out (see Section JSP.1.8.3, “Implicit Objects”). Its value varies:Initially, out is a new JspWriter object. This object may bedifferent from the stream object returned from response.getWriter(), and may be considered to be interposed on the latter in order to implement buffering (see Section JSP.1.10.1, “The page Directive”). This is the initial out object. JSP page authors are prohibited from writingdirectly to either the PrintWriter or OutputStream associated with the ServletResponse.The JSP container should not invoke response.getWriter() until the time when the first portion of the content is to be sent to the client.This enables a number of uses of JSP, including using JSP as a language to “glue” actions that deliver binary content, or reliably forwarding to a servlet, or change dynamically the content type of the response before generating content. See Chapter JSP.4, “Internationalization Issues”.Within the body of some actions, out may be temporarily re-assigned to a different (nested) instance of a JspWriter object. Whether this is the case depends on the details of the action’s semantics. Typically the content of these temporary streams is appended to the stream previously referred to by out, and out is subsequently re-assignedto refer to the previous (nesting) stream. Such nested streams are always buffered, and require explicit flushing to a nesting stream or their contents will be discarded.If the initial out JspWriter object is buffered, then depending upon the value of the autoFlush attribute of the page directive, the content of that buffer will either be automatically flushed out to the ServletResponse output stream to obviate overflow, or an exception shall be thrown to signal buffer overflow. If the initial out JspWriter is unbuffered, then content written to it will be passed directly through to the ServletResponse output stream.A JSP page can also describe what should happen when some specific events occur. In JSP 2.1, the only events that can be described are the initialization and the destruction of the第 3 页共 19 页中北大学信息商务学院2015届毕业设计外文文献原文及译文page. These events are described using “well-known method names”in declaration elements..JavaScript is used for the first kind is browser, the dynamicgeneral purpose of client scripting language. Netscape first proposed in 1995, but its JavaScript LiveScript called. Then quickly Netscape LiveScript renamed JavaScript, Java developers with them from the same issued a statement. A statement Java and JavaScript will complement each other, but they are different, so the technology of the many dismissed the misunderstanding of the two technologies.JavaScript to create user interface control provides a scripting language. In fact, in the browser into the JavaScript code logic. It can support such effect: when the cursor on the Web page of a mobile user input validation or transform image.Microsoft also write out their JavaScript version and the JScript called. Microsoft and Netscape support JavaScript and JScript around a core characteristics and European Manufacturers is.md by (ECMA) standards organization, the control standard of scripting language. ECMA its scripting language ECMAScript named.Servlets and JSPs often include fragments of information that are common to an organization, such as logos, copyrights, trademarks, or navigation bars. The web application uses the include mechanisms to import the information wherever it is needed, since it is easier to change content in one place then to maintain it in every piece of codewhere it is used. Some of this information is static and either never or rarely changes, such as an organization's logo. In other cases, the information is more dynamic and changes often and unpredictably, such as a textual greeting that must be localized for each user. In both cases, you want to ensure that the servlet or JSP can evolve independently ofits included content, and that the implementation of the servlet or JSP properly updates its included content as necessary.You want to include a resource that does not change very much (suchas a page fragment that represents a header or footer) in a JSP. Use the include directive in the including JSP page, and give the included JSP segment a .jspf extension.You want to include content in a JSP each time it receives a request, rather than when the JSP is converted to a servlet. Use the jsp:include standard action.You want to include a file dynamically in a JSP, based on a value derived from a configuration file. Use the jsp:include standard action. Provide the value in an external properties file or as a configuration parameter in the deployment descriptor.You want to include a fragment of an XML file inside of a JSP document, or include a JSP page in XML syntax. Use the jsp:include standard action for the includes that you want to第 4 页共 19 页中北大学信息商务学院2015届毕业设计外文文献原文及译文occur with each request of the JSP. Use the jsp:directive.include element if the include action should occur during the translation phase.You want to include a JSP segment from outside the including file's context. Use the c:importThe operation principle and the advantages of JSP tagsIn this section of the operating principle of simple introductionJSP and strengths.For the first time in a JSP documents requested by the engine, JSP Servlet is transformed into a document JSP. This engine is itself a Servlet. The operating process of the JSP shown below:(1) the JSP engine put the JSP files converting a Java source files (Servlet), if you find the files have any grammar mistake JSP,conversion process will interrupt, and to the server and client output error messages.(2) if converted, with the engine JSP javac Java source filecompiler into a corresponding scale-up files.(3) to create a the Servlet (JSP page), the transformation of the Servlet jspInit () method was executed, jspInit () method in the life cycle of Servlet executed only once.(4) jspService () method invocation to the client requests. For each request, JSP engine to create a new thread for processing the request.If you have multiple clients and request the JSP files, JSP engine will create multiple threads. Each client requests a thread. To executemulti-thread can greatly reduce the requirement of system resources,improving the concurrency value and response time. But also should notice the multi-thread programming, due to the limited Servlet always in response to memory, so is very fast.(5) if the file has been modified. The JSP, server will be set according to the document to decide whether to recompile, if need to recompile, will replace the Servlet compile the memory and continue the process.(6) although the JSP efficiency is high, but at first when the need to convert and compile and some slight delay. In addition, if at any time due to reasons of system resources, JSP engine will in some way of uncertain Servlet will remove from memory. When this happens jspDestroy () method was first call.第 5 页共 19 页中北大学信息商务学院2015届毕业设计外文文献原文及译文(7) and then Servlet examples were marked with "add" garbage collection. But in jspInit () some initialization work, if establish connection with database, or to establish a network connection, from a configuration file take some parameters, such as, in jspDestory () release of the corresponding resources.Based on a Java language has many other techniques JSP page dynamic characteristics, technical have embodied in the following aspects: One simplicity and effectiveness:The JSP dynamic web pages with the compilation ofthe static HTML pages of writing is very similar. Just in theoriginal HTML page add JSP tags, or some of the proprietary scripting (this is not necessary). So, a familiar with HTML page write design personnel may be easily performed JSP page development. And the developers can not only, and write script by JSP tags used exclusively others have written parts to realize dynamic pages. So, an unfamiliar with the web developers scripting language, can use the JSP make beautiful dynamic pages. And this in other dynamic web development is impossible.Tow the independence of the program:The JSP are part of the familyof the API Java, ithas the general characteristics of the cross-platform Java program. In other words, is to have the procedure, namely the independence of the platform, 6 Write bided anywhere! .Three procedures compatibility:The dynamic content can various JSP form, so it canshow for all kinds of customers, namely from using HTML/DHTML browser to use various handheld wireless equipment WML (for example, mobile phones and pdas), personal digital equipment to use XML applications, all can use B2B JSP dynamic pages.Four program reusability:In the JSP page can not directly, but embedded scriptingdynamic interaction will be cited as a component part. So, once such a component to write, it can be repeated several procedures, the programof the reusability. Now, a lot of standard JavaBeans library is a good example.第 6 页共 19 页中北大学信息商务学院2015届毕业设计外文文献原文及译文JSP技术简介及特点JSP(Java Server Pages)技术是由Sun公司发布的用于开发动态Web应用的一项技术。

jsp网站开发毕设外文翻译

jsp网站开发毕设外文翻译

jsp网站开发毕设外文翻译西安邮电大学外文文献翻译院 (系): 计算机学院专业: 计算机科学与技术班级:学生姓名: 导师姓名: 职称:起止时间:2011年 9月23日至 2012年 6月2日原文:Java and the InternetAlthough Java is very useful for solving traditional stand-alone programming problems, it is also important because it will solve programming problems on the World Wide Web.1. Client-side programmingThe Web’s initial server-browser design provided for interactive content, but the interactivity was completely provided by the server. The server produced static pages for the client browser, which would simply interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset t he data on the form or “submit” the data on the form back to the server. This submission passes through the Common Gateway Interface (CGI) provided on all Web servers. The text within the submission tells CGI what to do with it. The most common action is to run a programlocated on the server in a directory that’s typically called “cgi-bin.” (If you watch the address window at the topof your browser when you push a button on a Web page, you can sometimes see “cgi-bin” within all thegobbledygook there.) These programs can be written in most languages. Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardless of processor or operating system.Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem of response time. The response of a CGI program depends on how much data must be sent, as well as the load on both the serverand the Internet. (On top of this, starting a CGI program tends to be slow.) The initial designers of the Web did not foresee how rapidly this bandwidth would be exhausted for the kinds of applications people developed. For example, any sort of dynamic graphing is nearlyimpossible to perform with consistency because a GIF file must becreated and moved from the server to the client for each version of the graph. And you’ve no doubt had direct ex perience with something as simple as validating the data on an input form. You press the submit button on a page; the data is shipped back to the server; the server starts a CGI program that discovers an error, formats an HTML page informing you of the error, and then sends the page back to you; youmust then back up a page and try again. Not only is this slow, it’s inelegant.The solution is client-side programming. Most machines that run Web browsers are powerful engines capable of doing vast work, and with the original static HTML approach they are sitting there, just idly waiting for the server to dish up the next page. Client-side programming means that the Web browser is harnessed to do whatever work it can, and the result for the user is a much speedier and more interactive experience at your Web site.The problem with discussions of client-side programming is that they aren’t very different fromdiscussions of programming in general. The parameters are almost the same, but the platform is different: a Web browser is like a limited operating system. In the end, you must still program, and this accounts for the dizzying array of problems and solutions produced by client-side programming. The rest of this section provides an overview of the issues and approaches in client-side programming. 2.Plug-insOne of the most significant steps forward in client-side programming is the development of the plug-in. This is a way for a programmer to add new functionality to the browser by downloading a piece of code that plugs itself into the appropriate spot in the browser. It tells the browser “from now on you can perform this new activity.” (You need to download the plug-in only once.) Some fast and powerfulbehavior is added to browsers via plug-ins, but writing a plug-in is not a trivial task, and isn’t somethingyou’d want to do as part of the process of building a particular site. The value of the plug-in forclient-side programming is that it allows an expert programmer to develop a new language and add that language to a browser without the permission of the browser manufacturer. Thus, plug-ins provide a “back door” that allows the creation of new client-side programming languages (although not alllanguages are implemented as plug-ins).3.Scripting languagesPlug-ins resulted in an explosion of scripting languages. With a scripting language you embed the source code for your client-side program directly into the HTML page, and the plug-in that interpretsthat language is automatically activated while the HTML page is being displayed. Scripting languages tend to be reasonably easy to understand and, because they are simply text that is part of an HTML page, they load very quickly as part of the single server hit required to procure that page. The trade-off is that your code is exposed for everyone to see (and steal). Generally, however, you aren’t doing amazingly sophisticated things with scripting languages so this is not too much of a hardship. This points out that the scripting languages used inside Web browsers are really intended to solve specific types of problems, primarily the creation of richer and more interactive graphical userinterfaces (GUIs). However, a scripting language might solve 80 percent of the problems encountered in client-side programming. Your problems might very well fit completely within that 80 percent, and sincescripting languages can allow easier and faster development, you should probably consider a scripting language before looking at a more involved solution such as Java or ActiveX programming. The most commonly discussed browser scripting languages are JavaScript (which has nothing to do with Java; it’s named that way just to grab some of Java’s marketing momentum), VBScript (whichlooks like Visual Basic), and Tcl/Tk, which comes from the popular cross-platform GUI-building language. There are others out there, and no doubt more in development.JavaScript is probably the most commonly supported. It comes builtinto both Netscape Navigatorand the Microsoft Internet Explorer (IE). In addition, there are probably more JavaScript books available than there are for the other browser languages, and some tools automatically create pages using JavaScript. However, if you’re already fluent in Visual Basic or Tcl/Tk, you’ll be mor e productive using those scripting languages rather than learning a new one. (You’ll have your hands full dealing with the Web issues already.)4.JavaIf a scripting language can solve 80 percent of the client-side programming problems, what about the other 20 percent—the “really hardstuff?” The most popular solution today is Java. Not only is it a powerful programming language built to be secure, cross-platform, and international, but Java is being continually extended to provide language features and libraries that elegantly handle problems that are difficult in traditional programming languages, such as multithreading, database access, network programming, and distributed computing. Java allows client-side programming via the applet. An applet is a mini-program that will run only under a Web browser. The applet is downloaded automatically as part of a Web page (just as, for example, a graphic is automatically downloaded).it provides you with a When the applet is activated it executes a program. This is part of its beauty—way to automatically distribute the client software from the server at the time the user needs the client software, and no sooner. The user gets the latest version of the client software without fail and without difficult reinstallation. Because of the way Java is designed, the programmer needs to create only a single program, and that program automatically works with all computers that have browsers with built-in Java interpreters. (This safely includes the vast majority of machines.) Since Java is a full-fledged programming language, you can do as much work as possible on the client before and after making requests of the server. For example, you won’t need to send a request form across the Internet todiscover that you’ve gotten a d ate or some other parameter wrong, and your client computer can quickly do the work of plotting data instead of waiting for the server to make a plot and ship a graphic image back to you. Not only do you get the immediate win of speed and responsiveness, but the general network traffic and load on servers can be reduced, preventing the entire Internet from slowing down. One advantage a Java applet has over a scripted program is that it’s in compiled form, so the sourcecode isn’t available to the client. O n the other hand, a Javaapplet can be decompiled without too much trouble, but hiding your code is often not an important issue. Two other factors can be important. As you will see later in this book, a compiled Java applet can comprise many modules and t ake multiple server “hits” (accesses) to download. (In Java 1.1 and higher this is minimized by Java archives, called JAR files, that allow all the required modules to be packaged together and compressed for a single download.) A scripted program will just be integrated into the Web page as part of its text (and will generally be smaller and reduce server hits). This could be important to the responsiveness of your Web site. Another factor is the all-important learning curve. Regardless of what you’ve heard, Java is not a trivial language to learn. If you’re a Visual Basic programmer, moving to VBScript will be your fastest solution, and since it will probably solve most typical client/server problems you might be hard pressed to justify learning Java. If yo u’re experienced with a scripting language you willcertainly benefit from looking at JavaScript or VBScript before committing to Java, since they might fit your needs handily and you’ll bemore productive sooner.to run its applets withi5.ActiveXTo so me degree, the competitor to Java is Microsoft’s ActiveX, although it takes a completely different approach. ActiveX wasoriginally a Windows-only solution, although it is now being developed via an independent consortium to become cross-platform. Effectively, ActiveX says “if yourprogram connects to its environment just so, it can be dropped into a Web page and run under a browser that supports ActiveX.” (IE directly supports ActiveX and Netscape does so using a plug-in.) Thus, ActiveX does not constrain you to a particular language. If, for example, you’re already an experienced Windows programmer using a language such as C++, Visual Basic, or Borland’s Delphi, you can create ActiveX components with almost no changes to your programming knowledge. ActiveX also provides a path for the use of legacy code in your Web pages.6.Internet vs. intranetThe Web is the most general solution to the client/server problem,so it makes sense that you can use the same technology to solve a subset of the problem, in particular the classic client/server problem within a company. With traditional client/server approaches you have the problemof multiple types of client computers, as well as the difficulty of installing new client software, both of which are handily solved with Web browsers and client-side programming. When Web technology is used for an information network that is restricted to a particular company, it is referred to as an intranet. Intranets provide much greater security than the Internet, since you can physically control access to the servers within your company. In terms of training, it seems that once people understand the general concept of a browser it’s much easier for them to deal with differences in the way pages and applets look, so thelearning curve for new kinds of systems seems to be reduced.The security problem brings us to one of the divisions that seems to be automatically forming in the world of client-side programming. If your program is running on the Internet, you don’t know what platform it will be working under, and you want to be extra careful that you don’t disseminate buggy code. You need something cross-platform and secure, like a scripting language or Java. If you’re running on an intranet, you might have a different set of constraints. It’s not uncommon that your machines could all be Intel/Windows platforms. On an intranet, you’re responsible for the quality of your own code and can repair bugs when they’re discovered. In addition, you might already have abody of legacy code that you’ve been using in a more traditional client/server approach, whereby you must physically install clientprograms every time you do an upgrade. The time wasted in installing upgrades is the most compelling reason to move to browsers, because upgrades are invisible and automatic. If you are involved in such an intranet, the most sensible approach to take is the shortest path that allows you to use your existing code base, rather than trying to recode your programs in a new language.When faced with this bewildering array of solutions to the client-side programming problem, the bestplan of attack is a cost-benefit analysis. Consider the constraints of your problem and what would be the shortest path to your solution. Since client-side programming is still programming, it’s always a good idea to take the fastest development approach for your particular situation. This is an aggressive stance to prepare for inevitable encounters with the problems of program development.翻译:Java和因特网Java除了可解决传统的程序设计问题以外,还能解决World Wide Web(万维网)上的编程问题。

计算机科学与技术专业JSP及其WEB技术大学毕业论文外文文献翻译及原文

计算机科学与技术专业JSP及其WEB技术大学毕业论文外文文献翻译及原文

毕业设计(论文)外文文献翻译文献、资料中文题目:SP及其WEB技术文献、资料英文题目:文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期: 2017.02.14外文翻译原文及译文JSP and WEB technolog1 JSP IntroductionJSP (JavaServer Pages) is a Java-based scripting technology. Is advocated by Sun Microsystems Inc., together with a number of companies involved in the establishment of a dynamic web page technology standards. JSP technology is somewhat similar to ASP technology, It is a traditional HTML page file (*. htm, *. html) to insert Java program segment (Scriptlet) and JSP tag (tag), To form the JSP file(*jsp). Web development with JSP is a cross-platform applications that can run under Linux, but also in other operating systems. In the JSP of the many advantages, one of which is that it will be HTML encoded Web page from the business logic separated effectively. JSP access with reusable components, such as Servlet, JavaBean and Java-based Web applications. JSP also supports directly in the Web page embedded Java code. JSP can be used two ways to access documents: JSP documents sent by the browser request, the request sent to the Servlet. JSP technology uses Java programming language, XML-type tags and scriptlets, to have a package deal with the logic of dynamic pages. Page tags and scriptlets can also exist in the server access to the resources of the application logic. JSP logic and Web page design and display isolated and support reusable component-based design, Web-based applications more quickly and easily developed.The Web server when meets visits the JSP homepage the request, first carries out segment, will then carry out the result code to return together with JSP in the document HTML for the customer. The insertion Java segment may operate the database, again the directional homepage and so on, realizes the function which the establishment dynamic homepage needs. JSP and Java Servlet are the same, is in the server end execution, usually returns to this client side is a HTML text, therefore client side, so long as has the browser to be able to glance over.The JSP page is composed of the HTML code and the inserting Java code. The server in the page by the client side was requested that later will carry on processing to these Java code, will then produce the HTML page will return gives the client side thebrowser. Java Servlet is the JSP technology base, moreover the large-scale Web application procedure's development needs Java Servlet and the JSP coordination can complete. JSP had the Java technology simply easy to use, complete object-oriented, had the platform independency, and safe reliable, mainly faced Internet's all characteristics.2 JSP computing techniqueTo carry on the dynamic website conveniently fast the development, JSP has made the improvement in the following several aspects, causes it to become builds the cross platform fast the dynamic website first choice plan.2.1 carries on the content production and the demonstration separatesWith the JSP technology, the Web page development personnel may use HTML or the XML marking design and the formatted final page, and uses the JSP marking or the tootsy produces on page's dynamic content originally. Production content's logic is sealed in marks and in the JavaBeans module, and ties up in the script, all scripts in server end movement. Because core logic is sealed in marks and in JavaBeans, therefore the Web administrative personnels and the page designer, can edit and use the JSP page, but does not affect the content the production. In the server end, the JSP engine explained that the JSP marking and the script, produce the content which requested, and (or XML) page's form transmits the result by HTML the browser. This both are helpful in the author protects own code, and can guarantee any based on the HTML Web browser's complete usability.2.2 may entrust with heavy responsibility the moduleThe overwhelming majority JSP page relies on may entrust with heavy responsibility, the cross platform module (JavaBeans or Enterprise the JavaBeans module) carries out complex processing which the application procedure requests. The development personnel can share and exchange the execution ordinary operation the module, or causes these modules uses for more users and the customer association. Has accelerated the overall development process based on module's method, and causes each kind of organization obtains balanced in their existing skill and in the optimized result development endeavor.2.3 uses markingThe Web page development personnel will not be the familiar script languageprogrammers. The JSP technology has sealed many functions, these functions are easy to use, marking to carry on the dynamic content production with JSP in the related XML to need. The standard JSP marking can visit and the instantiation JavaBeans module, the establishment or the retrieval module attribute, downloads Applet, as well as the execution difficulty with codes and the time-consuming function with other methods.2.4 adapts the platformNearly all platforms support Java, JSP+JavaBeans to be possible to pass unimpeded nearly under all platforms. Transplants from a platform to other platform, JSP and JavaBeans does not even need to translate, because the Java byte code is standard has nothing to do with the platform.2.5 database connectionIn Java connects the database the technology is the JDBC, Java procedure is connected through the JDBC driver and the database, operations and so on execution inquiry, extraction data. Sun Corporation has also developed JDBC-ODBC bridge, uses this technical Java procedure to be possible to visit has the ODBC driver database, at present the majority database systems have the ODBC driver, therefore the Java procedure can visit such as Oracle, Sybase, MS SQL Server and databases and so on MS Access. In addition, through the development marking storehouse, the JSP technology may further expand. The third party development personnel and other personnel may found their marking storehouse for the commonly used function. This enables the Web page development personnel to be able to use the familiar tool and to be similar to marking same carries out the specific function component to carry on the work. The JSP technology very easy conformity to many kinds of application architecture, to use the extant tool and the skill, and can expand to the support enterprise distributional application.3 Eclipse function synopsisMore and more Java development personnel already started the productivity which and the quality income appreciates Eclipse JDT to provide. It was the Java editor provides grammar Gao Liang to demonstrate that the formatting, the fold, the content were auxiliary, code template and so on many functions. It grows unceasingly available restructuring and the code generation function set permits you in a higher rank the operation code, andautomated usual code intensity duty and easy wrong duty. Moreover, in develops the code and uses JDT to compile and to carry out the JUnit test built-in support carries on the unit testing after the code, may use Eclipse the first-class Java debugger debugging when the movement meets any question. Besides JDT, Eclipse SDK- the most popular downloading - also contains Plug-in Development Environment(PDE). PDE used the specific function to expand JDT to construct the Eclipse plug-in unit - based on the Eclipse application procedure basic construction agglomeration. In fact, uses the tool which provides by Eclipse itself to be able to surmount the Java development, may expand the existing Eclipse application procedure, or even founds the brand-new application procedure.Eclipse by a script level constitution, contains in many functional modules or the Eclipse terminology so-called “the plug-in unit”. The plug-in unit is provides all functions in the Eclipse application procedure the module. They cooperate through its API to pay the final outcome together. In Eclipse, even the most foundation's function, for instance the search and the start installment's plug-in unit, seals in the plug-in unit. In order to expand the existing Eclipse function or carry on the construction in above, the plug-in unit the concrete expansion contribution for the expansion spot which will expose by other plug-in units. Usually, the plug-in unit concentrates the specific region responsibility, and gives through or a many expansion way other responsibility designation other plug-in units. For example, a plug-in unit allows you parallel to compare two documents visibly the contents, but it will not care how to read these documents even how to explain these document structure; This is other plug-in unit's work. When compared with two documents, this plug-in unit first inspects whether to have another plug-in unit to be possible to explain these document structure. If found one, it to the plug-in unit inquiry related file organization information which found, and used this information in the comparison process.May see that the modular construction was Eclipse has provided the huge flexibility, and provided one to be possible to support the massive application procedure platform which the original design has not expected.4 Structs function synopsisStruts is a MVC frame (Framework), uses in developing Java fast the Web application.Struts realizes the key point in C(Controller), Action which and we have custom-made including ActionServlet/RequestProcessor, was also V(View) provides a series of rows to have custom-made the label (Custom Tag). Spring is a light vessel (light-weight container), its core is the Bean factory (Bean Factory), with constructs M(Model) which we need. Above this foundation, Spring has provided AOP (Aspect-Oriented Programming, face stratification plane programming) realization, provides under the non-management environment with it to declare services and so on way business, security; Is more convenient to Bean factory expansion ApplicationContext we to realize the J2EE application; DAO/ORM realizes facilitates us to carry on the database the development; Web MVC and Spring Web have provided Java the Web application frame or carries on the integration with other popular Web frame. That is may a both use, achieve both own characteristic carries on supplementary.Structs is the kind which, servlet and the JSP mark a group cooperates mutually, they compose the MVC 2 designs which may entrust with heavy responsibility. This definition expressed that Struts is a frame, but is not a storehouse, but Struts has also contained the rich mark storehouse and the independence in this frame work utility program class.Client browser (customer browser), the request founds an event from customer browser's each HTTP. The Web vessel will use a HTTP response to make the response.Controller (controller), the controller receive from browser's request, and decided that sends out where this request. Speaking of Struts, the controller is an order design pattern which realizes by servlet. struts-config.xml document disposition controller.Service logic, the service logic renewal model's condition, and helps the control application procedure the flow. Speaking of Struts, this is through takes the actual service logic “thin” the packing Action kind to complete.Model (model) condition, model expression application procedure condition. Service object renewal application procedure condition. ActionForm bean in conversation level or request level expression model condition, but is not in the lasting level. The JSP document uses JSP to mark the read from the ActionForm bean information.View (view), the view is a JSP document. And does not have the flow logic, does not have the service logic, also does not have the model information -- Only then marks. The mark causes Struts is different with other frames (for example Velocity) one of factors.Just like the Struts controller is (event usually is HTTP post) maps the event kind of。

外文文献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 peopl e’s concern.JSP provided a special development environment for the Web application that establishes the high dynamic state。

JSP外文文献原稿和译文

JSP外文文献原稿和译文

外文文献原稿和译文原稿JSPJSP (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 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 tocomplete. 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.JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the client. So, JavaScript is not a competing technology; it is a complementary one.It is also possible to use JavaScript on the server, most notably on Sun ONE (formerly iPlanet), IIS, and BroadVision servers. However, Java is more powerful, flexible, reliable, and portable.JSP (a recursive acronym for "JSP: Hypertext Preprocessor") is a free, open-source, HTML-embedded scripting language that is somewhat similar to both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is JSP.Versus Pure Servlets.JSP doesn't provide any capabilities that couldn't, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.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 to the 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.Know servlets for four reasons:1.JSP pages get translated into servlets. You can't understand how JSP works without understanding servlets.2.JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java code? Servlet code! You can't write that code if you don't understand servlet programming.3.Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.4.Some tasks are better accomplished by a combination of servlets and JSP than by either servlets or JSP alone.Versus JavaScriptJavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the client. So, JavaScript is not a competing technology; it is a complementary one.JSP is by no means perfect. Many people have pointed out features that could be improved. This is a good thing, and one of the advantages of JSP is that the specification is controlled by a community that draws from many different companies. So, the technology can incorporate improvements in successive releases.However, some groups have developed alternative Java-based technologies to try to address these deficiencies. This, in our judgment, is a mistake. Using a third-party tool like Apache Struts that augments JSP and servlet technology is a good idea when that tool adds sufficient benefit to compensate for the additional complexity. But using a nonstandard tool that tries to replace JSP is a bad idea. When choosing a technology, you need to weigh many factors: standardization, portability, integration, industry support, and technical features. The arguments for JSP alternatives have focused almost exclusively on the technical features part. But portability, standardization, and integration are also very important. For example, the servlet and JSP specifications define a standard directory structure for Web applications and provide standard files (.war files) for deploying Web applications. All JSP-compatible servers must support these standards. Filters can be set up to apply to any number of servlets or JSP pages, but not to nonstandard resources. The same goes for Web application security settings.JSP six built-in objects:request, response, out, session, application, config, pagecontext, page, exception. ONE.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.TWO.Response object:The customer's request dynamic response to the client sent the data.THREE.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.FORE.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.FIVE.out targetsout as a target output flow, used to client output data. out targets for the output data. SIX.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.译文JSPJSP(JavaServer Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。

外文翻译--JSP及其WEB技术

外文翻译--JSP及其WEB技术

外文翻译原文及译文JSP and WEB technolog1 JSP IntroductionJSP (JavaServer Pages) is a Java-based scripting technology. Is advocated by Sun Microsystems Inc., together with a number of companies involved in the establishment of a dynamic web page technology standards. JSP technology is somewhat similar to ASP technology, It is a traditional HTML page file (*. htm, *. html) to insert Java program segment (Scriptlet) and JSP tag (tag), To form the JSP file(*jsp). Web development with JSP is a cross-platform applications that can run under Linux, but also in other operating systems. In the JSP of the many advantages, one of which is that it will be HTML encoded Web page from the business logic separated effectively. JSP access with reusable components, such as Servlet, JavaBean and Java-based Web applications. JSP also supports directly in the Web page embedded Java code. JSP can be used two ways to access documents: JSP documents sent by the browser request, the request sent to the Servlet. JSP technology uses Java programming language, XML-type tags and scriptlets, to have a package deal with the logic of dynamic pages. Page tags and scriptlets can also exist in the server access to the resources of the application logic. JSP logic and Web page design and display isolated and support reusable component-based design, Web-based applications more quickly and easily developed.The Web server when meets visits the JSP homepage the request, first carries out segment, will then carry out the result code to return together with JSP in the document HTML for the customer. The insertion Java segment may operate the database, again the directional homepage and so on, realizes the function which the establishment dynamic homepage needs. JSP and Java Servlet are the same, is in the server end execution, usually returns to this client side is a HTML text, therefore client side, so long as has the browser to be able to glance over.The JSP page is composed of the HTML code and the inserting Java code. The server in the page by the client side was requested that later will carry on processing to these Java code, will then produce the HTML page will return gives the client side the browser. Java Servlet is the JSP technology base, moreover the large-scale Web applicationprocedure's development needs Java Servlet and the JSP coordination can complete. JSP had the Java technology simply easy to use, complete object-oriented, had the platform independency, and safe reliable, mainly faced Internet's all characteristics.2 JSP computing techniqueTo carry on the dynamic website conveniently fast the development, JSP has made the improvement in the following several aspects, causes it to become builds the cross platform fast the dynamic website first choice plan.2.1 carries on the content production and the demonstration separatesWith the JSP technology, the Web page development personnel may use HTML or the XML marking design and the formatted final page, and uses the JSP marking or the tootsy produces on page's dynamic content originally. Production content's logic is sealed in marks and in the JavaBeans module, and ties up in the script, all scripts in server end movement. Because core logic is sealed in marks and in JavaBeans, therefore the Web administrative personnels and the page designer, can edit and use the JSP page, but does not affect the content the production. In the server end, the JSP engine explained that the JSP marking and the script, produce the content which requested, and (or XML) page's form transmits the result by HTML the browser. This both are helpful in the author protects own code, and can guarantee any based on the HTML Web browser's complete usability.2.2 may entrust with heavy responsibility the moduleThe overwhelming majority JSP page relies on may entrust with heavy responsibility, the cross platform module (JavaBeans or Enterprise the JavaBeans module) carries out complex processing which the application procedure requests. The development personnel can share and exchange the execution ordinary operation the module, or causes these modules uses for more users and the customer association. Has accelerated the overall development process based on module's method, and causes each kind of organization obtains balanced in their existing skill and in the optimized result development endeavor.2.3 uses markingThe Web page development personnel will not be the familiar script language programmers. The JSP technology has sealed many functions, these functions are easy touse, marking to carry on the dynamic content production with JSP in the related XML to need. The standard JSP marking can visit and the instantiation JavaBeans module, the establishment or the retrieval module attribute, downloads Applet, as well as the execution difficulty with codes and the time-consuming function with other methods.2.4 adapts the platformNearly all platforms support Java, JSP+JavaBeans to be possible to pass unimpeded nearly under all platforms. Transplants from a platform to other platform, JSP and JavaBeans does not even need to translate, because the Java byte code is standard has nothing to do with the platform.2.5 database connectionIn Java connects the database the technology is the JDBC, Java procedure is connected through the JDBC driver and the database, operations and so on execution inquiry, extraction data. Sun Corporation has also developed JDBC-ODBC bridge, uses this technical Java procedure to be possible to visit has the ODBC driver database, at present the majority database systems have the ODBC driver, therefore the Java procedure can visit such as Oracle, Sybase, MS SQL Server and databases and so on MS Access. In addition, through the development marking storehouse, the JSP technology may further expand. The third party development personnel and other personnel may found their marking storehouse for the commonly used function. This enables the Web page development personnel to be able to use the familiar tool and to be similar to marking same carries out the specific function component to carry on the work. The JSP technology very easy conformity to many kinds of application architecture, to use the extant tool and the skill, and can expand to the support enterprise distributional application.3 Eclipse function synopsisMore and more Java development personnel already started the productivity which and the quality income appreciates Eclipse JDT to provide. It was the Java editor provides grammar Gao Liang to demonstrate that the formatting, the fold, the content were auxiliary, code template and so on many functions. It grows unceasingly available restructuring and the code generation function set permits you in a higher rank the operation code, and automated usual code intensity duty and easy wrong duty. Moreover, in develops the codeand uses JDT to compile and to carry out the JUnit test built-in support carries on the unit testing after the code, may use Eclipse the first-class Java debugger debugging when the movement meets any question. Besides JDT, Eclipse SDK- the most popular downloading - also contains Plug-in Development Environment(PDE). PDE used the specific function to expand JDT to construct the Eclipse plug-in unit - based on the Eclipse application procedure basic construction agglomeration. In fact, uses the tool which provides by Eclipse itself to be able to surmount the Java development, may expand the existing Eclipse application procedure, or even founds the brand-new application procedure.Eclipse by a script level constitution, contains in many functional modules or the Eclipse terminology so-called “the plug-in unit”. The plug-in unit is provides all functions in the Eclipse application procedure the module. They cooperate through its API to pay the final outcome together. In Eclipse, even the most foundation's function, for instance the search and the start installment's plug-in unit, seals in the plug-in unit. In order to expand the existing Eclipse function or carry on the construction in above, the plug-in unit the concrete expansion contribution for the expansion spot which will expose by other plug-in units. Usually, the plug-in unit concentrates the specific region responsibility, and gives through or a many expansion way other responsibility designation other plug-in units. For example, a plug-in unit allows you parallel to compare two documents visibly the contents, but it will not care how to read these documents even how to explain these document structure; This is other plug-in unit's work. When compared with two documents, this plug-in unit first inspects whether to have another plug-in unit to be possible to explain these document structure. If found one, it to the plug-in unit inquiry related file organization information which found, and used this information in the comparison process.May see that the modular construction was Eclipse has provided the huge flexibility, and provided one to be possible to support the massive application procedure platform which the original design has not expected.4 Structs function synopsisStruts is a MVC frame (Framework), uses in developing Java fast the Web application. Struts realizes the key point in C(Controller), Action which and we have custom-madeincluding ActionServlet/RequestProcessor, was also V(View) provides a series of rows to have custom-made the label (Custom Tag). Spring is a light vessel (light-weight container), its core is the Bean factory (Bean Factory), with constructs M(Model) which we need. Above this foundation, Spring has provided AOP (Aspect-Oriented Programming, face stratification plane programming) realization, provides under the non-management environment with it to declare services and so on way business, security; Is more convenient to Bean factory expansion ApplicationContext we to realize the J2EE application; DAO/ORM realizes facilitates us to carry on the database the development; Web MVC and Spring Web have provided Java the Web application frame or carries on the integration with other popular Web frame. That is may a both use, achieve both own characteristic carries on supplementary.Structs is the kind which, servlet and the JSP mark a group cooperates mutually, they compose the MVC 2 designs which may entrust with heavy responsibility. This definition expressed that Struts is a frame, but is not a storehouse, but Struts has also contained the rich mark storehouse and the independence in this frame work utility program class.Client browser (customer browser), the request founds an event from customer browser's each HTTP. The Web vessel will use a HTTP response to make the response.Controller (controller), the controller receive from browser's request, and decided that sends out where this request. Speaking of Struts, the controller is an order design pattern which realizes by servlet. struts-config.xml document disposition controller.Service logic, the service logic renewal model's condition, and helps the control application procedure the flow. Speaking of Struts, this is through takes the actual service logic “thin” the packing Action kind to complete.Model (model) condition, model expression application procedure condition. Service object renewal application procedure condition. ActionForm bean in conversation level or request level expression model condition, but is not in the lasting level. The JSP document uses JSP to mark the read from the ActionForm bean information.View (view), the view is a JSP document. And does not have the flow logic, does not have the service logic, also does not have the model information -- Only then marks. The mark causes Struts is different with other frames (for example Velocity) one of factors.Just like the Struts controller is (event usually is HTTP post) maps the event kind of servlet. you to expect - the air-operated controller use configuration files to cause you notto need to carry on to these values the hard code. The time has changed, but method as before.The Action kind, ActionForm maintains the Web application procedure the conversation condition. ActionForm is one abstract class, must found this kind of subclass for each input form model. When I said when input form model, what refers to the ActionForm expression is establishes or in the renewal general sense data by the HTML form.The Action kind is service logic packing. A Action kind of use is transforms HttpServletRequest into the service logic. Must use Action, please found its subclass and covers process () the method.ActionServlet (Command) will use perform () the method the parametrization kind to transmit for ActionForm. Still did not have too many repugnant request.getParameter () to transfer. When the event progresses to this step, the input form data (or HTML form data) has been withdrawn from the request class and shifts to the ActionForm kind.Considered that a Action kind of another way is the Adapter design pattern. The Action use will be “a kind of connection will transform another connection which will need for the client. Adapter enables the kind the joint operation, if does not have Adapter, then these kinds will be unable because of the incompatible connection the joint operation.”.In this example's client is ActionServlet, it knows nothing about to our concrete service class connection. Therefore, Struts has provided a service connection which it can understand, namely Action. Through expands Action, we cause our service connection and the Struts service connection maintain compatible.5 CSS synopsisThe CSS edition method is the same with HTML, may also be any text editor or the homepage edition software, but also has uses for to edit CSS specially the software. If you write the CSS sentence regards the exterior cascading style sheet, but transfers in the HTML document, then its extension saves .css to be possible. Initially the technical personnel found out HTML, mainly stresses on the definition content, for instance expressed that a paragraph, indicates the title, but excessively has not designed HTML the typesetting and the contact surface effect.Along with the Internet rapid development, HTML is widely applied, the surfer people hoped certainly that the homepage makes attractive, therefore the HTMLtypesetting and the contact surface effect's limitation exposes day by day. In order to solve this problem, the people also took many tortuous paths, has used some not good method, for instance increases many attribute results to HTML becomes the code very extremely fat, turns the picture the text, excessively many comes the typesetting using Table, expresses the white space with the blank picture and so on. Appears until CSS.CSS may be a homepage design breakthrough, it has solved the homepage contact surface typesetting difficult problem. May such say that HTML Tag is mainly defines the homepage content (Content), but CSS decided how these homepage content does demonstrate (Layout). The CSS English is Cascading Style Sheets, Chinese may translate the tandem cascading style sheet. CSS may divide into three kinds according to its position: In inlays the style (Inline Style), internal cascading style sheet (Internal Style Sheet), exterior cascading style sheet (External Style Sheet).6 HTML function synopsisHyper Text Markup the Language hypertext mark language is one kind uses for to manufacture the hypertext documents the simple mark language. The hypertext documents which compiles with HTML are called the HTML documents, it can the independence in each kind of operating system platform (for example UNIX, WINDOWS and so on). HTML has served as since 1990 on World Wide Web the information to express the language, uses in describing the Homepage form design and it and on WWW the other Homepage linked information.The HTML documents (i.e. the Homepage source document) was one has laid aside the mark ASCII text document, usually it had .html or the .htm document extension. Produces HTML documents mainly to have the following three ways: 1. the manual direct compilation (e.g. ASCII text editor which or other HTML edition tool likes with you). 2. will have other form documents through certain format conversion tool (for example the WORD documents) to transform the HTML documents. 3. by the Web server (or said that the HTTP server) one only then real-time dynamic produces. the HTML language is through uses each kind of mark (tags) to mark the documents the structure as well as marks the ultra chain (Hyperlink) the information.Although the HTML language described the documents structure form, but how can't define the documents information to precisely demonstrate and arrange, but is onlysuggested how the Web browser (for example Mosiac, Netscape and so on) should demonstrate and arrange these information, is decided finally in front of user's demonstration result by the Web browser's demonstration style and to the mark explanatory ability. Why is the identical documents the effect which demonstrated in the different browser meets is dissimilar. At present the HTML language's edition is 2.0, it is based on SGML (Standard Generalized Markup Language, standard sets at sign language generally, as soon as is applies mechanically describes digitized documents structure and manages its content complex standard) a subset to evolve comes. Although in next edition's standard HTML3.0 (is also called HTML+) to draw up, but some the partial experimental nature draft standard widely has been used, the mostly outstanding Web browser (for example Netscape and so on) can explain in the HTML3.0 part new mark, therefore introduced in this chapter some HTML3.0 new mark has been accepted by the most browsers.7 Js script language synopsisJS is javascrip, Javascript is one kind the script language which comes by the Netscape LiveScript development, the main purpose is to solve the server terminal language, for instance Perl, carry-over speed question. At that time served the end to need to carry on the confirmation to the data, because the network speed was quite slow, only then 28.8kbps, the confirmation step waste's time were too many. Therefore Netscape browser Navigator has joined Javascript, has provided the data confirmation basic function.The JavaScript official name is “ECMAScript”. This standard by ECMA organizat ion development and maintenance. ECMA-262 is the official JavaScript standard. This standard based on JavaScript (Netscape) and JScript (Microsoft). Netscape (Navigator 2.0) Brendan Eich has invented this language, started from 1996, already appeared in all Netscape and in the Microsoft browser. The ECMA-262 development began in 1996, in 1997 July, the ECMA general meeting has accepted its first edition.Script script uses one specific descriptive language, rests on certain form compilation to be possible the execution document, is also called as great or the batch run document. The script usually may transfer temporarily by the application procedure and carry out. Each kind of script present widely is applied in the homepage design, because the script not only may reduce the homepage the scale and raises the homepage browsing speed,moreover may enrich the homepage performance, like animation, sound and so on. Cites a most common example, when we click in the homepage the E-mail address can transfer Outlook Express or the Foxmail this kind of mail software automatically, is realizes through the script function. Also because of script these characteristics, the human who harbors ulterior motives by some are often using. For example joins some destruction computer system's order in the script, like this works as the user browsing homepage, once transfers this kind of script, will then cause the user the system to come under the attack. Therefore the user should act according to visits homepage the trust degree selective security rank, specially regarding these itself content on the illegal homepage, do not permit the use script easily. Through “the safe establishment” the dialog box, the choice “the script” under option each kind of establishment may with ease re alize to script being forbid and begins using.Present's script language is quite many, script language execution generally only with concrete explanation actuator related, so long as therefore on the system has the corresponding language interpreter to be possible to achieve the cross platform. Script (Script), is includes order and so on bind and alias sets, you may save this set are an independent document then in the time which needs carries out, like this may facilitate you in the CS use. The script may save for the suffix named .cfg document places under the cstrike folder, when execution in control bench input: exec (script filename) .cfg then. For instance saves a script is the buys.cfg document, inputs in the control bench: execbuys.cfg may realize the function which we need. Must realize an order, so long as is good this process definition (alias), and assigns a key position for this order, so long as later according to will assign the good key position, may realize this proce沈阳航空航天大学毕业设计(论文)外文翻译——译文JSP及其WEB技术. 1 JSP简介JSP(JavaServer Pages)是一种基于Java的脚本技术。

JSP技术概述与应用框架外文翻译毕业设计

JSP技术概述与应用框架外文翻译毕业设计
国际化:使JSP应用能够适应不同 国家和地区的语言和文化环境
国际化与本地化的重要性:提高 用户体验,增强市场竞争力
添加标题
添加标题
添加标题
添加标题
本地化:根据不同国家和地区的 语言和文化环境,对JSP应用进行 定制和优化
国际化与本地化的实现方法:使 用国际化框架,如i18n,进行国 际化和本地化处理
翻译质量要求
准确性:确保翻译内容与原文意思一致,无错译、漏译现象 流畅性:翻译语言通顺,符合目标语言的表达习惯 专业性:翻译内容涉及专业术语,需准确翻译,不得随意更改 格式规范:翻译后的文档格式应与原文保持一致,包括字体、字号、行距等
PART 6
毕业设计流程与规范
选题与开题报告撰写
选题:选择与专 业相关的课题, 确保具有研究价 值和实际意义
特点:Spring MVC具有清晰的分层结构,易于扩展和维护,支持RESTful风格,支持 多种视图技术。
核心组件:Spring MVC的核心组件包括DispatcherServlet、HandlerMapping、 Controller、ViewResolver等。
应用场景:Spring MVC广泛应用于Web开发中,如企业级应用、电子商务、社交网站等。
JSP可以与其他 Java技术(如 Servlet、 JDBC、JNDI等) 无缝集成,实现 强大的Web应 用程序开发。
JSP工作原理
JSP是一种服务器端的Java技术,用于创 建动态网页。
JSP页面由HTML、Java代码和JSP标签组 成。
JSP页面在服务器上被编译成Java Servlet,然后由Servlet引擎执行。
翻译质量:准色等
翻译时间:根据毕业设计进度, 合理安排翻译时间

关于JSP的介绍-本科生毕业设计(论文)外文翻译

关于JSP的介绍-本科生毕业设计(论文)外文翻译

xx 理工大学xx 学院毕业设计(论文)外文资料翻译系:计算机系专业:计算机科学与技术姓名:xxx学号:080601165外文出处:Anon .The Introduction Of JSP [EB/OL].(用外文写)(2009-01-13)[2011-12-20].http://nibiye.com/fy/wwfy/jsjw/2009/0113/1033.html.附件:1.外文资料翻译译文;2.外文原文。

注:请将该封面与附件装订成册。

附件1:外文资料翻译译文关于JSP的介绍Java2企业版(J2EE)已经把建立一个网上的乱中有律任务的存在现象进行了有效的改造,就是开发人员能使用Java有效创造多层次的服务器端应用程序。

今天,Java企业应用程序编程接口已经扩大,包括许多方面:远程方法调用与公共对象请求代理体系结构用来远程对象的处理,JDBC(Java数据库的连接)的数据库交互,JNDI(Java命名和目录接口)来访问命名和目录服务,为企业创造了可重复使用的JavaBeans业务组件、JMS(Java信息服务)消息中介软件,JAXP为XML(可扩展标示语言)处理和JTA(Java事务应用程序界面)为执行一个原子事务。

此外,J2EE也支持小型服务程序,极受欢迎的Java语言代替了公共网关接口脚本。

这些技术的结合,可以让程序员创造分布式业务解决方案中的各种任务。

早在在1999年末,Sun Microsystems(美国一家计算机公司)添加了一个新的精选的元素企业Java工具:Java动态服务器页面(JSP)。

Java动态服务器页面都是建立在Java的顶部小型服务器用来增进效率使程序员,甚至是非专业的程序员,都可以创建网页的内容。

那么什么是Java服务器页呢?我们来简洁明点,Java的动态服务器页面是一个运用科学技术发展的网页,其中是包括动态内容的。

不像一个HTML页面,只包含静态内容,总是保持不变的,一个JSP页面中可以改变它的内容基于任何数量的变项,包括用户的身份,用户的浏览器类型,用户信息的提供,或者由用户选择信息等等。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
业务逻辑 业务逻辑更新模型的状态,并帮助控制应用程序的流。就 Struts 而言,这就 是通过作为实际业务逻辑“瘦”包装的 Action 类完成的。
模型状态 模型代表了应用程序的状态。业务对象更新应用程序的状态。ActionForm bean 在会话级或请求级表示模型的状态,而不是在持久级。JSP 文件使用 JSP 标记读取来自 ActionForm bean 的信息。
该生所译的“ Technology for Web Application”一文与其毕业设计课题
有一定的关联,译文整体较为准确,翻译后的文章符合中文的习惯。但还有个别的
词翻译的不够准确,个别的语句不够通顺。总的来说此译文是一篇合格的译文。
签名:
Struts——An Open-source MVC Implementation
如果你开发过大型 Web 应用程序,你就理解“变化”这个词语。“模型-视图控制器”(MVC) 就是用来帮助你控制变化的一种设计模式。MVC 减弱了业务逻辑 接口和数据接口之间的耦合。Struts 是一种 MVC 实现,它将 Servlet 2.2 和 JSP 1.1 标记(属于 J2EE 规范)用作实现的一部分。你可能永远不会用 Struts 实现一 个系统,但了解一下 Struts 或许使你能将其中的一些思想用于你以后的 Servlet 和 JSP 实现中。 模型-视图-控制器 (MVC)
视图 视图就是一个 JSP 文件。其中没有流程逻辑,没有业务逻辑,也没有模型 信息 -- 只有标记。标记是使 Struts 有别于其他框架(如 Velocity)的因素 之一。
Struts 详细资料 在图 6 中展示了一个无其他附属设备的阿帕奇 struts 的 action 包的 UML 图表。 图 6 显示了 ActionServlet (Controller)、 ActionForm (Form State) 和 Action (Model Wrapper) 之间的最小关系。 图 6. 命令(ActionServlet) 与 模型 (Action & ActionForm) 之间的关系的 UML 图
该生所译的“Struts——An Open-source MVC Implementation”一文与其毕业设
计课题有一定的关联,译文整体较为准确,翻译后的文章符合中文的习惯。但还有
个别的词翻译的不够准确,个别的语句不够通顺。总的来说此译文是一篇合格的译
文。
签名:
2011 年 3 月 25 日
指导教师评语:
考虑 Action 类的另一种方式是 Adapter 设计模式。 Action 的用途是“将类的 接口转换为客户机所需的另一个接口。Adapter 使类能够协同工作,如果没有 Adapter,则这些类会因为不兼容的接口而无法协同工作。”(摘自 Gof 所著的 Design Patterns - Elements of Reusable OO Software )。本例中的客户机是 ActionServlet ,它对我们的具体业务类接口一无所知。因此,Struts 提供了它能够 理解的一个业务接口,即 Action 。通过扩展 Action ,我们使得我们的业务接口与 Struts 业务接口保持兼容。(一个有趣的发现是, Action 是类而不是接口)。 Action 开始为一个接口,后来却变成了一个类。真是金无足赤。)
Struts 框架在将在传递它到业务包装 UserAction 之前将更新 UserActionForm 的状态。
在传递它到 Action 类之前,Struts 将还会对 UserActionForm 调用 validation() 方法进行表单验证。 备注: 这样做通常并不明智。别的网页或 业务对象可能有方法使用 UserActionForm ,然而验证可能不同。在 UserAction 类中进行状态验证可能更好。
毕业设计(论文)外文 资料翻译
题 目: Struts——An Open-source MVC Implementation Struts——一种开源 MVC 的实现
院系名称: 专业班级: 学生姓名: 指导教师: 起止日期: 地 点:
学 号: 教师职称:
附 件: 1.外文资料翻译译文;2.外文原文。
指导教师评语:
这里的时间,输入表并 进入 ActionForm 类中。
注:扩展 Action 类时请注意简洁。 Action 类应该控制应用程序的流程,而不 应该控制应用程序的逻辑。通过将业务逻辑放在单独的包或 EJB 中,我们就可以 提供更大的灵活性和可重用性。
Error 类 UML 图(图 6)还包括 ActionError 和 ActionErrors 。 ActionError 封装了单 个错误消息。 ActionErrors 是 ActionError 类的容器,View 可以使用标记访问这 些类。 ActionError 是 Struts 保持错误列表的方式。 图 7. Command (ActionServlet) 与 Model (Action) 之间的关系的 UML 图
网页设计人员不必费力地通过 Java 代码来理解应用程序的流程。 当流程发生改变时 Java 开发人员不需要重新编译代码。 通过扩展 ActionServlet 命令函数可以被添加进来。
ActionForm 类 ActionForm 维持着 Web 应用程序的会话状态。 ActionForm 是一个必须为每 个输入表单模型创建该类的子类的抽象类。当我说 输入表单模型 时,我就是说 ActionForm 代表了一个由 HTML 表单设置或更新的一般意义上的数据。例如,你 可能有一个由 HTML 表单设置的 UserActionForm 。Struts 框架将会:
Action 类 Action 类是一个围绕业务逻辑的一个包装器。 Action 类的目的就是将 HttpServletRequest 翻译给业务逻辑。要使用 Action ,需重写 process() 原理。 ActionServlet (命令)通过使用 perform() 原理将参数化的类传递给 ActionForm 。此外,没有太多讨厌的 request.getParameter() 调用。通过事件到达
检查 UserActionForm 是否存在;如果不存在,它将会创建该类的 一个实例。
Struts 将使用 HttpServletRequest 中相应的域设置 UserActionForm 的状态。没有太多糟糕的请求.getParameter() 调用。例如, Struts 框架将从请求流中提取 fname 并调用 UserActionForm.setFname() 。
2011 年 3 月 25 日
附件 1:外文资料翻译译文
Struts——一种开源 MVC 的实现
这篇文章介绍 Struts,一个使用 servlet 和 JavaServer Pages 技术的一种 Model-View-Controller 的实现。Struts 可以帮助你控制 Web 项目中的变化并提高 专业化。即使你可能永远不会用 Struts 实现一个系统,你可以获得一些想法用于你 未来的 servlet 和 JSP 网页的实现中。 简介
Java 程序员应该开发服务,而不是 HTML。 布局的改变将需要改变代码。 服务的客户将有能力去创造一些页面去满足他们的一些特殊需求。 页面设计人员将不能直接介入到页面的开发中。 嵌入在代码中的 HTML 将会变得丑陋。 对于 Web,MVC 的经典形式将需要改变。图 4 展示了 MVC 的 Web 适应,也 就是通常所说的 MVC 模型 2 或者 MVC 2。. 图 4. MVC 模型 2
ActionServlet 类 你还记得使用函数映射的日子吗?你会映射一些输入时间到一个函数的一个 指针。如果你很老练,你可以把这些配置信息放进一个文件里并且在运行时加载该 文件。函数指针装扮了在 C 语言结构化程序设计中的旧时光。 现在日子好过多了,自从我们有了 Java 技术、XML、J2EE 等等之后。Struts 控制器是一个映射事件(事件通常是一个 HTTP post)到类的一个 servlet。猜猜 怎么着-- 控制器用一个配置文件以致于你不必非硬编码这些值。生活变了,但方法 依然如此。 ActionServlet 是 MVC 实现的命令部分并且它是框架的核心。 ActionServlet (Command) 创建并使用 Action 、 ActionForm 和 ActionForward 。正如前面所提 及的, struts-config.xml 文件配置 Command。在 Web 工程创建期间, Action 和 ActionForm 被扩展用来解决特殊的问题空间。文件 struts-config.xml 指导 ActionServlet 如何扩展这些类。这种方法有几个优点:
JSP 标签只解决了我们问题中的一部分。我们依然有验证、流控制、以及更新 应用程序结构的问题。这就是 MVC 从哪儿来以及来干嘛的。MVC 通过把问题分成 三类来帮助解决一些与单模块相关的问题:
Model(模型) 模块包括应用程序功能的核心。模型封装着应用程序的各个结构。有时它所 包含的唯一功能就是结构。它对于视图或者控制器一无所知。
UserActionForm 能够维持一个会话级别 。
备注:
struts-config.xml 文件控制着 HTML 表单请求与 ActionForm 之 间的映射。
多重请求会被映射到 UserActionForm 。 UserActionForm 可被映射到诸如向导之类的多重页面的东西上。
View(视图) 视图提供了模型的演示。它是应用程序的外表。视图可以进入模型获得者,
但是它对于设置者一无所知。除此之外,它对于控制器也是一无所知。视图 仅仅当模型发生改变的时候才被通知。
Controller(控制器) 控制器对于用户的输入做出反应。它创造和设置模型。
相关文档
最新文档