JAVA外文文献翻译基于Java技术的Web应用设计模型的比较研究

合集下载

javaweb英文参考文献

javaweb英文参考文献

javaweb英文参考文献Below is an example of a reference list for JavaWeb related articles:1. Anderson, J., & Anderson, L. (2018). Building Java Web Services. McGraw-Hill Education.This book provides a comprehensive guide to building Java web services. It covers topics such as creating web services using SOAP and RESTful principles, handling data exchange formats like XML and JSON, and implementing security measures. The book also provides practical examples and code snippets to help readers understand the concepts better.2. Liang, Y. D. (2014). Introduction to Java Programming: Comprehensive Version. Pearson.Although this book is not specifically focused on JavaWeb, it serves as an essential reference for any Java programmer. It covers the basics of Java programming, including object-oriented concepts, control structures, and data types. Understanding these fundamentals is crucial when developing Java web applications.3. Liguori, R., & Liguori, P. (2019). Java Web Development with Servlets, JSP, and EJB. Packt Publishing.This book is a practical guide to Java web development. It introduces the Servlet and JavaServer Pages (JSP) technologies, which are key components in JavaWeb application development. It also covers Enterprise JavaBeans (EJB) and database integration,helping readers build robust and scalable web applications.4. Ambler, S. W. (2015). Agile Modeling: Effective Practices for Extreme Programming and the Unified Process. John Wiley & Sons.Agile modeling is crucial for efficient JavaWeb development. This book introduces various agile practices and principles, such as iterative development, user stories, and test-driven development. It can help developers understand how to adapt their Java web development processes to be more agile and responsive to changing requirements.5. Somekh, A., & Kogan, Y. (2017). Java Web Development: From Beginner to Professional. Apress.This book provides a step-by-step guide to Java web development, starting from the basics and gradually advancing to more complex topics. It covers important concepts such as servlets, JSPs, JavaBeans, and the MVC (Model-View-Controller) architecture, enabling readers to build professional Java web applications.6. Holmes, J., & Brown, J. (2016). Java Web Applications: Servlets, JSP, Frameworks. Prentice Hall.This book offers a comprehensive overview of Java web development, focusing on servlets, JSP, and popular frameworks such as Spring and Struts. It covers topics like session management, authentication and authorization, and integrating databases into Java web applications. The book also provides real-worldexamples and best practices for developing robust and scalable web applications.Remember to check the specific formatting guidelines required by your institution or journal for properly citing the references.。

计算机 java 外文翻译 外文文献 英文文献

计算机 java 外文翻译 外文文献 英文文献

英文原文:Title: Business Applications of Java. Author: Erbschloe, Michael, Business Applications of Java -- Research Starters Business, 2008DataBase: Research Starters - BusinessBusiness Applications of JavaThis article examines the growing use of Java technology in business applications. The history of Java is briefly reviewed along with the impact of open standards on the growth of the World Wide Web. Key components and concepts of the Java programming language are explained including the Java Virtual Machine. Examples of how Java is being used bye-commerce leaders is provided along with an explanation of how Java is used to develop data warehousing, data mining, and industrial automation applications. The concept of metadata modeling and the use of Extendable Markup Language (XML) are also explained.Keywords Application Programming Interfaces (API's); Enterprise JavaBeans (EJB); Extendable Markup Language (XML); HyperText Markup Language (HTML); HyperText Transfer Protocol (HTTP); Java Authentication and Authorization Service (JAAS); Java Cryptography Architecture (JCA); Java Cryptography Extension (JCE); Java Programming Language; Java Virtual Machine (JVM); Java2 Platform, Enterprise Edition (J2EE); Metadata Business Information Systems > Business Applications of JavaOverviewOpen standards have driven the e-business revolution. Networking protocol standards, such as Transmission Control Protocol/Internet Protocol (TCP/IP), HyperText Transfer Protocol (HTTP), and the HyperText Markup Language (HTML) Web standards have enabled universal communication via the Internet and the World Wide Web. As e-business continues to develop, various computing technologies help to drive its evolution.The Java programming language and platform have emerged as major technologies for performing e-business functions. Java programming standards have enabled portability of applications and the reuse of application components across computing platforms. Sun Microsystems' Java Community Process continues to be a strong base for the growth of the Java infrastructure and language standards. This growth of open standards creates new opportunities for designers and developers of applications and services (Smith, 2001).Creation of Java TechnologyJava technology was created as a computer programming tool in a small, secret effort called "the Green Project" at Sun Microsystems in 1991. The Green Team, fully staffed at 13 people and led by James Gosling, locked themselves away in an anonymous office on Sand Hill Road in Menlo Park, cut off from all regular communications with Sun, and worked around the clock for18 months. Their initial conclusion was that at least one significant trend would be the convergence of digitally controlled consumer devices and computers. A device-independent programming language code-named "Oak" was the result.To demonstrate how this new language could power the future of digital devices, the Green Team developed an interactive, handheld home-entertainment device controller targeted at the digital cable television industry. But the idea was too far ahead of its time, and the digital cable television industry wasn't ready for the leap forward that Java technology offered them. As it turns out, the Internet was ready for Java technology, and just in time for its initial public introduction in 1995, the team was able to announce that the Netscape Navigator Internet browser would incorporate Java technology ("Learn about Java," 2007).Applications of JavaJava uses many familiar programming concepts and constructs and allows portability by providing a common interface through an external Java Virtual Machine (JVM). A virtual machine is a self-contained operating environment, created by a software layer that behaves as if it were a separate computer. Benefits of creating virtual machines include better exploitation of powerful computing resources and isolation of applications to prevent cross-corruption and improve security (Matlis, 2006).The JVM allows computing devices with limited processors or memory to handle more advanced applications by calling up software instructions inside the JVM to perform most of the work. This also reduces the size and complexity of Java applications because many of the core functions and processing instructions were built into the JVM. As a result, software developers no longer need to re-create the same application for every operating system. Java also provides security by instructing the application to interact with the virtual machine, which served as a barrier between applications and the core system, effectively protecting systems from malicious code.Among other things, Java is tailor-made for the growing Internet because it makes it easy to develop new, dynamic applications that could make the most of the Internet's power and capabilities. Java is now an open standard, meaning that no single entity controls its development and the tools for writing programs in the language are available to everyone. The power of open standards like Java is the ability to break down barriers and speed up progress.Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards. There are over 3 million Java developers and now there are several versions of the code. Most large corporations have in-house Java developers. In addition, the majority of key software vendors use Java in their commercial applications (Lazaridis, 2003).ApplicationsJava on the World Wide WebJava has found a place on some of the most popular websites in the world and the uses of Java continues to grow. Java applications not only provide unique user interfaces, they also help to power the backend of websites. Two e-commerce giants that everybody is probably familiar with (eBay and Amazon) have been Java pioneers on the World Wide Web.eBayFounded in 1995, eBay enables e-commerce on a local, national and international basis with an array of Web sites-including the eBay marketplaces, PayPal, Skype, and -that bring together millions of buyers and sellers every day. You can find it on eBay, even if you didn't know it existed. On a typical day, more than 100 million items are listed on eBay in tens of thousands of categories. Recent listings have included a tunnel boring machine from the Chunnel project, a cup of water that once belonged to Elvis, and theV olkswagen that Pope Benedict XVI owned before he moved up to the Popemobile. More than one hundred million items are available at any given time, from the massive to the miniature, the magical to the mundane, on eBay; the world's largest online marketplace.eBay uses Java almost everywhere. To address some security issues, eBay chose Sun Microsystems' Java System Identity Manager as the platform for revamping its identity management system. The task at hand was to provide identity management for more than 12,000 eBay employees and contractors.Now more than a thousand eBay software developers work daily with Java applications. Java's inherent portability allows eBay to move to new hardware to take advantage of new technology, packaging, or pricing, without having to rewrite Java code ("eBay drives explosive growth," 2007).Amazon (a large seller of books, CDs, and other products) has created a Web Service application that enables users to browse their product catalog and place orders. uses a Java application that searches the Amazon catalog for books whose subject matches a user-selected topic. The application displays ten books that match the chosen topic, and shows the author name, book title, list price, Amazon discount price, and the cover icon. The user may optionally view one review per displayed title and make a buying decision (Stearns & Garishakurthi, 2003).Java in Data Warehousing & MiningAlthough many companies currently benefit from data warehousing to support corporate decision making, new business intelligence approaches continue to emerge that can be powered by Java technology. Applications such as data warehousing, data mining, Enterprise Information Portals (EIP's), and Knowledge Management Systems (which can all comprise a businessintelligence application) are able to provide insight into customer retention, purchasing patterns, and even future buying behavior.These applications can not only tell what has happened but why and what may happen given certain business conditions; allowing for "what if" scenarios to be explored. As a result of this information growth, people at all levels inside the enterprise, as well as suppliers, customers, and others in the value chain, are clamoring for subsets of the vast stores of information such as billing, shipping, and inventory information, to help them make business decisions. While collecting and storing vast amounts of data is one thing, utilizing and deploying that data throughout the organization is another.The technical challenges inherent in integrating disparate data formats, platforms, and applications are significant. However, emerging standards such as the Application Programming Interfaces (API's) that comprise the Java platform, as well as Extendable Markup Language (XML) technologies can facilitate the interchange of data and the development of next generation data warehousing and business intelligence applications. While Java technology has been used extensively for client side access and to presentation layer challenges, it is rapidly emerging as a significant tool for developing scaleable server side programs. The Java2 Platform, Enterprise Edition (J2EE) provides the object, transaction, and security support for building such systems.Metadata IssuesOne of the key issues that business intelligence developers must solve is that of incompatible metadata formats. Metadata can be defined as information about data or simply "data about data." In practice, metadata is what most tools, databases, applications, and other information processes use to define, relate, and manipulate data objects within their own environments. It defines the structure and meaning of data objects managed by an application so that the application knows how to process requests or jobs involving those data objects. Developers can use this schema to create views for users. Also, users can browse the schema to better understand the structure and function of the database tables before launching a query.To address the metadata issue, a group of companies (including Unisys, Oracle, IBM, SAS Institute, Hyperion, Inline Software and Sun) have joined to develop the Java Metadata Interface (JMI) API. The JMI API permits the access and manipulation of metadata in Java with standard metadata services. JMI is based on the Meta Object Facility (MOF) specification from the Object Management Group (OMG). The MOF provides a model and a set of interfaces for the creation, storage, access, and interchange of metadata and metamodels (higher-level abstractions of metadata). Metamodel and metadata interchange is done via XML and uses the XML Metadata Interchange (XMI) specification, also from the OMG. JMI leverages Java technology to create an end-to-end data warehousing and business intelligence solutions framework.Enterprise JavaBeansA key tool provided by J2EE is Enterprise JavaBeans (EJB), an architecture for the development of component-based distributed business applications. Applications written using the EJB architecture are scalable, transactional, secure, and multi-user aware. These applications may be written once and then deployed on any server platform that supports J2EE. The EJB architecture makes it easy for developers to write components, since they do not need to understand or deal with complex, system-level details such as thread management, resource pooling, and transaction and security management. This allows for role-based development where component assemblers, platform providers and application assemblers can focus on their area of responsibility further simplifying application development.EJB's in the Travel IndustryA case study from the travel industry helps to illustrate how such applications could function. A travel company amasses a great deal of information about its operations in various applications distributed throughout multiple departments. Flight, hotel, and automobile reservation information is located in a database being accessed by travel agents worldwide. Another application contains information that must be updated with credit and billing history from a financial services company. Data is periodically extracted from the travel reservation system databases to spreadsheets for use in future sales and marketing analysis.Utilizing J2EE, the company could consolidate application development within an EJB container, which can run on a variety of hardware and software platforms allowing existing databases and applications to coexist with newly developed ones. EJBs can be developed to model various data sets important to the travel reservation business including information about customer, hotel, car rental agency, and other attributes.Data Storage & AccessData stored in existing applications can be accessed with specialized connectors. Integration and interoperability of these data sources is further enabled by the metadata repository that contains metamodels of the data contained in the sources, which then can be accessed and interchanged uniformly via the JMI API. These metamodels capture the essential structure and semantics of business components, allowing them to be accessed and queried via the JMI API or to be interchanged via XML. Through all of these processes, the J2EE infrastructure ensures the security and integrity of the data through transaction management and propagation and the underlying security architecture.To consolidate historical information for analysis of sales and marketing trends, a data warehouse is often the best solution. In this example, data can be extracted from the operational systems with a variety of Extract, Transform and Load tools (ETL). The metamodels allow EJBsdesigned for filtering, transformation, and consolidation of data to operate uniformly on data from diverse data sources as the bean is able to query the metamodel to identify and extract the pertinent fields. Queries and reports can be run against the data warehouse that contains information from numerous sources in a consistent, enterprise-wide fashion through the use of the JMI API (Mosher & Oh, 2007).Java in Industrial SettingsMany people know Java only as a tool on the World Wide Web that enables sites to perform some of their fancier functions such as interactivity and animation. However, the actual uses for Java are much more widespread. Since Java is an object-oriented language like C++, the time needed for application development is minimal. Java also encourages good software engineering practices with clear separation of interfaces and implementations as well as easy exception handling.In addition, Java's automatic memory management and lack of pointers remove some leading causes of programming errors. Most importantly, application developers do not need to create different versions of the software for different platforms. The advantages available through Java have even found their way into hardware. The emerging new Java devices are streamlined systems that exploit network servers for much of their processing power, storage, content, and administration.Benefits of JavaThe benefits of Java translate across many industries, and some are specific to the control and automation environment. For example, many plant-floor applications use relatively simple equipment; upgrading to PCs would be expensive and undesirable. Java's ability to run on any platform enables the organization to make use of the existing equipment while enhancing the application.IntegrationWith few exceptions, applications running on the factory floor were never intended to exchange information with systems in the executive office, but managers have recently discovered the need for that type of information. Before Java, that often meant bringing together data from systems written on different platforms in different languages at different times. Integration was usually done on a piecemeal basis, resulting in a system that, once it worked, was unique to the two applications it was tying together. Additional integration required developing a brand new system from scratch, raising the cost of integration.Java makes system integration relatively easy. Foxboro Controls Inc., for example, used Java to make its dynamic-performance-monitor software package Internet-ready. This software provides senior executives with strategic information about a plant's operation. The dynamic performance monitor takes data from instruments throughout the plant and performs variousmathematical and statistical calculations on them, resulting in information (usually financial) that a manager can more readily absorb and use.ScalabilityAnother benefit of Java in the industrial environment is its scalability. In a plant, embedded applications such as automated data collection and machine diagnostics provide critical data regarding production-line readiness or operation efficiency. These data form a critical ingredient for applications that examine the health of a production line or run. Users of these devices can take advantage of the benefits of Java without changing or upgrading hardware. For example, operations and maintenance personnel could carry a handheld, wireless, embedded-Java device anywhere in the plant to monitor production status or problems.Even when internal compatibility is not an issue, companies often face difficulties when suppliers with whom they share information have incompatible systems. This becomes more of a problem as supply-chain management takes on a more critical role which requires manufacturers to interact more with offshore suppliers and clients. The greatest efficiency comes when all systems can communicate with each other and share information seamlessly. Since Java is so ubiquitous, it often solves these problems (Paula, 1997).Dynamic Web Page DevelopmentJava has been used by both large and small organizations for a wide variety of applications beyond consumer oriented websites. Sandia, a multiprogram laboratory of the U.S. Department of Energy's National Nuclear Security Administration, has developed a unique Java application. The lab was tasked with developing an enterprise-wide inventory tracking and equipment maintenance system that provides dynamic Web pages. The developers selected Java Studio Enterprise 7 for the project because of its Application Framework technology and Web Graphical User Interface (GUI) components, which allow the system to be indexed by an expandable catalog. The flexibility, scalability, and portability of Java helped to reduce development time and costs (Garcia, 2004)IssueJava Security for E-Business ApplicationsTo support the expansion of their computing boundaries, businesses have deployed Web application servers (WAS). A WAS differs from a traditional Web server because it provides a more flexible foundation for dynamic transactions and objects, partly through the exploitation of Java technology. Traditional Web servers remain constrained to servicing standard HTTP requests, returning the contents of static HTML pages and images or the output from executed Common Gateway Interface (CGI ) scripts.An administrator can configure a WAS with policies based on security specifications for Java servlets and manage authentication and authorization with Java Authentication andAuthorization Service (JAAS) modules. An authentication and authorization service can be written in Java code or interface to an existing authentication or authorization infrastructure. For a cryptography-based security infrastructure, the security server may exploit the Java Cryptography Architecture (JCA) and Java Cryptography Extension (JCE). To present the user with a usable interaction with the WAS environment, the Web server can readily employ a form of "single sign-on" to avoid redundant authentication requests. A single sign-on preserves user authentication across multiple HTTP requests so that the user is not prompted many times for authentication data (i.e., user ID and password).Based on the security policies, JAAS can be employed to handle the authentication process with the identity of the Java client. After successful authentication, the WAS security collaborator consults with the security server. The WAS environment authentication requirements can be fairly complex. In a given deployment environment, all applications or solutions may not originate from the same vendor. In addition, these applications may be running on different operating systems. Although Java is often the language of choice for portability between platforms, it needs to marry its security features with those of the containing environment.Authentication & AuthorizationAuthentication and authorization are key elements in any secure information handling system. Since the inception of Java technology, much of the authentication and authorization issues have been with respect to downloadable code running in Web browsers. In many ways, this had been the correct set of issues to address, since the client's system needs to be protected from mobile code obtained from arbitrary sites on the Internet. As Java technology moved from a client-centric Web technology to a server-side scripting and integration technology, it required additional authentication and authorization technologies.The kind of proof required for authentication may depend on the security requirements of a particular computing resource or specific enterprise security policies. To provide such flexibility, the JAAS authentication framework is based on the concept of configurable authenticators. This architecture allows system administrators to configure, or plug in, the appropriate authenticators to meet the security requirements of the deployed application. The JAAS architecture also allows applications to remain independent from underlying authentication mechanisms. So, as new authenticators become available or as current authentication services are updated, system administrators can easily replace authenticators without having to modify or recompile existing applications.At the end of a successful authentication, a request is associated with a user in the WAS user registry. After a successful authentication, the WAS consults security policies to determine if the user has the required permissions to complete the requested action on the servlet. This policy canbe enforced using the WAS configuration (declarative security) or by the servlet itself (programmatic security), or a combination of both.The WAS environment pulls together many different technologies to service the enterprise. Because of the heterogeneous nature of the client and server entities, Java technology is a good choice for both administrators and developers. However, to service the diverse security needs of these entities and their tasks, many Java security technologies must be used, not only at a primary level between client and server entities, but also at a secondary level, from served objects. By using a synergistic mix of the various Java security technologies, administrators and developers can make not only their Web application servers secure, but their WAS environments secure as well (Koved, 2001).ConclusionOpen standards have driven the e-business revolution. As e-business continues to develop, various computing technologies help to drive its evolution. The Java programming language and platform have emerged as major technologies for performing e-business functions. Java programming standards have enabled portability of applications and the reuse of application components. Java uses many familiar concepts and constructs and allows portability by providing a common interface through an external Java Virtual Machine (JVM). Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards.Java has found a place on some of the most popular websites in the world. Java applications not only provide unique user interfaces, they also help to power the backend of websites. While Java technology has been used extensively for client side access and in the presentation layer, it is also emerging as a significant tool for developing scaleable server side programs.Since Java is an object-oriented language like C++, the time needed for application development is minimal. Java also encourages good software engineering practices with clear separation of interfaces and implementations as well as easy exception handling. Java's automatic memory management and lack of pointers remove some leading causes of programming errors. The advantages available through Java have also found their way into hardware. The emerging new Java devices are streamlined systems that exploit network servers for much of their processing power, storage, content, and administration.中文翻译:标题:Java的商业应用。

计算机系 Java EE 外文翻译 外文文献 英文文献

计算机系 Java EE 外文翻译 外文文献 英文文献

外文科技资料翻译英文原文The Java EE Platform is the leading enterprise web server. The Adobe Flash Platform is the leader in the rich Internet application space. Using both, developers can deliver compelling, data-centric applications that leverage the benefits of an enterprise back-end solution and a great user experience.In this article, you learn about the architecture of applications built using Flex and Java including:(1)An overview of the client/server architecture.(2)The different ways the client and server can communicate.(3)An introduction to Flash Remoting and why and how you use it.(4)How to integrate a Flex application with your security framework.(5)An overview of how to build Flex applications using events, states,MXML components, and modules.(6)An introduction to developing a Flex application with real-time serverdata push.(7)How to boost productivity developing data-intensive applicationsusing the Data Management service in LiveCycle Data Services.(8)An overview of model driven development using Flash Builder andLiveCycle Data Services to generate client and server-side code.(9)How to deploy a Flex application on a portal server.(10)Be sure to also watch the video Introduction to Flex 4 and Javaintegration.(11)To learn more about the technologies used to build these applications,read The technologies for building Flex and Java applications article.Client/server architectureFlex and Java applications use a multi-tier architecture where the presentation tier is the Flex application, the business or application tier is the Java EE server and code, and the data tier is the database. You can write the back-end code just as you normally would for a Java application, modeling your objects, defining your database, using an object-relational framework such as Hibernate or EJB 3, and writing the business logic to query and manipulate these objects. The business tier must be exposed for access via HTTP from the Flex application and will be used to move the data between the presentation and data tiers.Typical HTML applications consist of multiple pages and as a user navigates between them, the application data must be passed along so the application itself (the collection of pages and functionality it consists of) can maintain state. In contrast, Flex applications, by nature, are stateful. A Flex application is embedded in a single HTML page that the user does not leave and is rendered by Flash Player. The Flex application can dynamically change views and send and retrieve data asynchronously to the server in the background, updating but never leaving the single application interface (see Figure 1) (similar to the functionality provided by the XMLHttpRequest API with JavaScript.)Figure 1. The client/server architecture.Client/server communicationFlex applications can communicate with back-end servers using either direct socket connections or more commonly, through HTTP. The Flex framework has three remote procedure call APIs that communicate with a server over HTTP: HTTPService, WebService, and RemoteObject. All three wrap Flash Player'sHTTP connectivity, which in turn, uses the browser's HTTP library. Flex applications cannot connect directly to a remote database.You use HTTPService to make HTTP requests to JSP or XML files, to RESTful web services, or to other server files that return text over HTTP. You specify the endpoint URL, listener functions (the callback functions to be invoked when the HTTPService request returns a successful or unsuccessful response), and a data type for the returned data (what type of data structure it should be translated into once received in the Flex application). You can specify the data to be handled as raw text and assigned to a String variable or converted to XML, E4X, or plain old ActionScript objects. If you get back JSON, you can use the Adobe Flex corelib package of classes to deserialize the JSON objects into ActionScript objects. To make calls to SOAP based web services, you can use the HTTPService API or the more specialized WebService API, which automatically handles the serialization and deserialization of SOAP formatted text to ActionScript data types and vice versa.The third option for making remote procedure calls is to use the RemoteObject API. It makes a Flash Remoting request to a method of a server-side Java class that returns binary Action Message Format over HTTP. When possible, use Flash Remoting whose binary data transfer format enables applications to load data up to 10 times faster than with the more verbose, text-based formats such as XML, JSON, or SOAP (see Figure 2). To see a comparison of AMF to other text-based serialization technologies, see James Ward's Census RIA Benchmark application.Figure 2. Methods for connecting Flex and Java.Flash RemotingFlash Remoting is a combination of client and server-side functionality that together provides a call-and-response model for accessing server-side objects from Flash Platform applications as if they were local objects. It provides transparent data transfer between ActionScript and server-side data types, handling the serialization into Action Message Format (AMF), deserialization, and data marshaling between the client and the server.Flash Remoting uses client-side functionality built in to Flash Player and server-side functionality that is built in to some servers (like ColdFusion and Zend) but must be installed on other servers (as BlazeDS or LiveCycle Data Services on Java EE servers, WebORB or FluorineFX on .NET servers, the Zend framework or amfphp on PHP servers, and more). See the technologies for building Flex and Java applications article for more details about BlazeDS and LiveCycle Data Services.BlazeDS and LiveCycle Data Services use a message-based framework to send data back and forth between the client and server. They provide Remoting, Proxying, and Messaging services, and for LiveCycle, an additional Data Management service. The Flex application sends a request to the server and the request is routed to an endpoint on the server. From the endpoint, the request is passed to the MessageBroker, the BlazeDS and LiveCycle Data Services engine that handles all the requests and routes them through a chain of Java objects to the destination, the Java class with the method to invoke (see Figure 3).Figure 3. Flash Remoting architecture.AMFAMF is a binary format used to serialize ActionScript objects and facilitate data exchange between Flash Platform applications and remote services over the Internet. Adobe publishes this protocol; the latest is AMF 3 Specification for ActionScript 3. You can find tables listing the data type mappings when converting from ActionScript to Java and Java to ActionScript here.For custom or strongly typed objects, public properties (including those defined with get and set methods) are serialized and sent from the Flex application to the server or from the server to the Flex application as properties of a general 0bject. To enable mapping between the corresponding client and server-side objects, you use the same property names in the Java and ActionScript classes and then in the ActionScript class, you use the [RemoteClass] metadata tag to create an ActionScript object that maps directly to the Java object.Here is an example Employee ActionScript class that maps to a server-side Employee Java DTO located in the services package on the server.package valueobjects.Employee{ [Bindable] [RemoteClass(alias="services.Employee")] public class Employee { public var id:int; public var firstName:String; public var lastName:String; (...) } }Installing BlazeDS or LiveCycle Data ServicesTo use Flash Remoting with BlazeDS or LiveCycle Data Services, you need to install and configure the necessary server-side files. For BlazeDS, you can download it as a WAR file which you deploy as a web application or as a turnkey solution. The turnkey download contains a ready-to-use version of Tomcat in which the the BlazeDS WAR file has already been deployed and configured along with a variety of sample applications. Similarly, for LiveCycle Data Services, the installer lets you choose to install LiveCycle with an integrated Tomcat server or as a LiveCycle Data Services web application.In either scenario a web application called blazeds or lcds (usually appended by a version number) is created. You can modify and build out this application with your Java code, or more typically, you can copy the JAR files and configuration files the blazeds or lcds web application contains and add them to an existing Java web application on the server (see Figure 4).Figure 4. The required BlazeDS or LiveCycle Data Services files.Modifying web.xmlIf copying the files to a different web application, you also need to modify the web.xml file to define a session listener for HttpFlexSession and a servlet mapping for MessageBroker, which handles all the requests and passes them off to the correct server-side Java endpoints. You can copy and paste these from the original blazeds or lcds web application web.xml file.<!-- Http Flex Session attribute and binding listener support --> <listener> <listener-class>flex.messaging.HttpFlexSession</listener-class> </listener> <!-- MessageBroker Servlet --> <servlet><servlet-name>MessageBrokerServlet</servlet-name><display-name>MessageBrokerServlet</display-name><servlet-class>flex.messaging.MessageBrokerServlet</servlet-class><init-param> <param-name>services.configuration.file</param-name><param-value>/WEB-INF/flex/services-config.xml</param-value></init-param> <load-on-startup>1</load-on-startup> </servlet><servlet-mapping> <servlet-name>MessageBrokerServlet</servlet-name><url-pattern>/messagebroker/*</url-pattern> </servlet-mapping>Optionally, you may also want to copy and paste (and uncomment) the mapping for RDSDispatchServlet, which is used for RDS (Remote Data Service) access with the data service creation feature in Flash Builder 4 that introspects a server-side service and generates corresponding client-side code. See the model driven development section for more details.<servlet> <servlet-name>RDSDispatchServlet</servlet-name><display-name>RDSDispatchServlet</display-name><servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class><init-param> <param-name>useAppserverSecurity</param-name><param-value>false</param-value> </init-param><load-on-startup>10</load-on-startup> </servlet> <servlet-mappingid="RDS_DISPATCH_MAPPING"><servlet-name>RDSDispatchServlet</servlet-name><url-pattern>/CFIDE/main/ide.cfm</url-pattern> </servlet-mapping> Reviewing services-config.xmlFor Flash Remoting, the client sends a request to the server to be processed and the server returns a response to the client containing the results. You configure these requests by modifying the services-config.xml and remoting-config.xml files located in the /WEB-INF/flex/ folder for the web application.The services-config.xml file defines different channels that can be used when making a request. Each channel definition specifies the network protocol and the message format to be used for a request and the endpoint to deliver the messages to on the server. The Java-based endpoints unmarshal the messages in a protocol-specific manner and then pass the messages in Java form to the MessageBroker which sends them to the appropriate service destination (you'll see how to define these next).<channels> <channel-definition id="my-amf"class="mx.messaging.channels.AMFChannel"> <endpointurl="http://{}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition><channel-definition id="my-secure-amf"class="mx.messaging.channels.SecureAMFChannel"> <endpointurl="https://{}:{server.port}/{context.root}/messagebroker/amfsecu re" class="flex.messaging.endpoints.SecureAMFEndpoint"/></channel-definition> (...) </channels>Defining destinationsIn the remoting-config.xml file, you define the destinations (named mappings to Java classes) to which the MessageBroker passes the messages. You set the source property to the fully qualified class name of a Java POJO with a no argument constructor that is located in a source path, usually achieved by placing it in the web application's /WEBINF/classes/ directory or in a JAR file in the /WEBINF/lib/ directory. You can access EJBs and other objects stored in the Java Naming and Directory Interface (JNDI) by calling methods on a destination that is a service facade class that looks up an object in JNDI and calls its methods.You can access stateless or stateful Java objects by setting the scope property to application, session, or request (the default). The instantiation and management of the server-side objects referenced is handled by BlazeDS or LiveCycle Data Services.<service id="remoting-service"class="flex.messaging.services.RemotingService"> <adapters><adapter-definition id="java-object"class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> </adapters> <default-channels> <channel ref="my-amf"/> </default-channels> <destination id="employeeService"> <properties><source>services.EmployeeService</source> <scope>application</scope></properties> </destination> </service>You can also specify channels for individual destinations.<destination id="employeeService " channels="my-secure-amf">Lastly, you use these destinations when defining RemoteObject instances in a Flex application.<s:RemoteObject id="employeeSvc" destination="employeeService"/>SecurityIn many applications, access to some or all server-side resources must be restricted to certain users. Many Java EE applications use container managed security in which user authentication (validating a user) and user authorization (determining what the user has access to—which is often role based) are performed against the Realm, an existing store of usernames, passwords, and user roles. The Realm is configured on your Java EE server to be a relational database, an LDAP directory server, an XML document, or to use a specific authentication and authorization framework.To integrate a Flex application with the Java EE security framework so that access to server-side resources is appropriately restricted, you add security information to the BlazeDS or LiveCycle Data Services configuration files (details follow below) and then typically in the Flex application, create a form to obtain login credentials from the user which are passed to the server to be authenticated. The user credentials are then passed to the server automatically with all subsequent requests.Modifying services-config.xmlIn the BlazeDS or LiveCycle Data Services services-config.xml file, you need to specify the "login command" for your application server in the <security> tag. BlazeDS and LiveCycle Data Services supply the following login commands: TomcatLoginCommand (for both Tomcat and JBoss), JRunLoginCommand, WeblogicLoginCommand, WebSphereLoginCommand, OracleLoginCommand. These are all defined in the XML file and you just need to uncomment the appropriate one.You also need to define a security constraint that you specify to use either basic or custom authentication and if desired, one or more roles. To do custom authentication with Tomat or JBoss, you also need to add some extra classes tothe web application for integrating with the security framework used by the Jave EE application server and modify a couple of configuration files. Mode details can be found here.<services-config> <security> <login-commandclass="flex.messaging.security.TomcatLoginCommand" server="Tomcat"><per-client-authentication>false</per-client-authentication></login-command> <security-constraint id="trusted"><auth-method>Custom</auth-method> <roles> <role>employees</role><role>managers</role> </roles> </security-constraint> </security> ...</services-config>Modifying remoting-config.xmlNext, in your destination definition, you need to reference the security constraint:<destination id="employeeService"> <properties><source>services.EmployeeService</source> </properties> <security><security-constraint ref="trusted"/> </security> </destination>You can also define default security constraints for all destinations and/or restrict access to only specific methods that can use different security constraints.The default channel, my-amf, uses HTTP. You can change one or more of the destinations to use the my-secure-amf channel that uses HTTPS:<destination id="employeeService"> <channels> <channelref="my-secure-amf"/> </channels> ... </destination>where my-secure-amf is defined in the services-config.xml file:<!-- Non-polling secure AMF --> <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> <endpointurl="https://{}:{server.port}/{context.root}/messagebroker/amfsecu re" class="flex.messaging.endpoints.SecureAMFEndpoint"/></channel-definition>Adding code to the Flex applicationThat covers the server-side setup. Now, if you are using custom authentication, you need to create a form in the Flex application to retrieve a username and password from the user and then pass these credentials to the server by calling the ChannelSet.login() method and then listening for its result and fault events. A result event indicates that the login (the authentication) occurred successfully, and a fault event indicates the login failed. The credentials are applied to all services connected over the same ChannelSet. For basic authentication, you don’t have to add anything to your Flex application. The browser opens a login dialog box when the application first attempts to connect to a destination.Your application can now make Flash Remoting requests to server destinations just as before, but now the user credentials are automatically sent with every request (for both custom and basic authentication). If the destination or methods of the destination have authorization roles specified which are not met by the logged in user, the call will return a fault event. To remove the credentials and log out the user, you use the ChannelSet.logout() method.中文译文Java EE平台是全球领先的企业Web服务器。

javaweb英文参考文献

javaweb英文参考文献

javaweb英文参考文献Title: The Evolution of Java Web Development: A Comprehensive Review of Related LiteratureAbstract:This literature review aims to provide a comprehensive analysis of the evolution of Java web development. The review covers the various aspects of Java web development, including its history, core technologies, frameworks, and tools. The analysis draws upon a wide range of scholarly articles and research papers to provide an in-depth understanding of the subject matter.1. IntroductionJava is a widely used programming language that has played a significant role in web development since its inception. This section provides an overview of the importance of Java in web development and highlights the need for a comprehensive review of the subject.2. History of Java Web DevelopmentThis section delves into the history of Java web development, starting from the introduction of Java applets in the mid-1990s to the development of modern web applications using Java Enterprise Edition (Java EE). It explores the evolution of Java Servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF) technologies, highlighting their contributions to web development.3. Core Technologies in Java Web DevelopmentThis section presents an overview of the core technologies involved in Java web development, such as Servlets, JSP,JavaServer Faces (JSF), Java Database Connectivity (JDBC), and Java Persistence API (JPA). The section examines their features, functionalities, and usage scenarios, emphasizing their role in building dynamic and interactive web applications.4. Java Web FrameworksThis section explores the evolution of various Java web frameworks, such as Spring MVC, Struts, JSF, and Play Framework. It analyzes the features and benefits of each framework, providing insights into their strengths and weaknesses. The section also discusses the emergence of lightweight frameworks like Spring Boot and Micronaut, which simplify web application development using Java.5. Java Web Development ToolsThis section presents a comprehensive overview of popular Java web development tools, including Integrated Development Environments (IDEs) like Eclipse and IntelliJ IDEA, build tools like Apache Maven and Gradle, and version control systems like Git. The review assesses the functionalities and usability of these tools, showcasing their importance in streamlining the web development process.6. Challenges and Solutions in Java Web DevelopmentThis section discusses the challenges faced in Java web development, including performance issues, scalability, security, and cross-platform compatibility. It explores the solutions proposed by developers and researchers, such as caching mechanisms, load balancing techniques, secure coding practices, and containerization using Docker.7. ConclusionThis literature review provides a comprehensive analysis of the evolution of Java web development. It covers the history of Java web development, core technologies, frameworks, tools, and challenges faced by developers. The review highlights the significance of Java in web development and serves as a valuable resource for researchers, developers, and practitioners in the field.。

java毕业设计外文文献原文及译文

java毕业设计外文文献原文及译文

毕业设计说明书英文文献及中文翻译学学 院:专指导教师:2014 年 6 月软件学院 软件工程Thinking in JavaAlthough it is based on C++, Java is more of a “pure” object-oriented C++ and Java are hybrid languages, but in Java the designers felt that the hybridization was not as important as it was in C++. A hybrid language allows multiple programming styles; the reason C++ is hybrid is to support backward compatibility with the C language. Because C++ is a superset of the C language, it includes many of that language’s undesirable features, which can make some aspects of C++ overly complicated. The Java language assumes that you want to do only object-oriented programming. This means that before you can begin you must shift your mindset into an object-oriented world (unless it’s already there). The benefit of this initial effort is the ability to program in a language that is simpler to learn and to use than many other OOP languages. In this chapter we’ll see the basic components of a Java program and we’ll learn that everything in Java is an object, even a Java program.Each programming language has its own means of manipulating data. Sometimes the programmer must be constantly aware of what type of manipulation is going on. Are you manipulating the object directly, or are you dealing with some kind of indirect representation (a pointer in C or C++) that must be treated with a special syntax?All this is simplified in Java. You treat everything as an object, using a single consistent syntax. Although you treat everything as an object, the identifier you manipulate is actually a “reference” to an object. You might imagine this scene as a television (the object) with your remote control (the reference). As long as you’re holding this reference, you have a connection to the television, but when someone says “change the channel” or “lower the volume,” what you’re manipulating is the reference, which in turn modifies the object. If you want to move around the room and still control the television, you take the remote/reference with you, not the television.Also, the remote control can stand on its own, with no television. That is, just because you have a reference doesn’t mean there’s necessarily an object connected to it. So if you want to hold a word or sentence, you create a String reference:But here you’ve created only the reference, not an object. If you decided to send a message to s at this point, you’ll get an error (at run time) because s isn’t actually attached to anything (there’s no television). A safer practice, then, is always to initialize a reference when you create it.However, this uses a special Java feature: strings can be initialized with quoted text. Normally, you must use a more general type of initialization for objectsWhen you create a reference, you want to connect it with a new object. You do so, in general, with the new keyword. The keyword new says, “Make me a new one of these objects.” So in the preceding example, you can say:Not only does this mean “Make me a new String,” but it also gives information about how to make the String by supplying an initial character string.Of course, String is not the only type that exists. Java comes with a plethora of ready-made types. What’s more important is that you can create your own types. In fact, that’s the fundamental activity in Java programming, and it’s what you’ll b e learning about in the rest of this bookIt’s useful to visualize some aspects of how things are laid out while the program is running—in particular how memory is arranged. There are six different places to store data: Registers. This is the fastest storage because it exists in a place different from that of other storage: inside the processor. However, the number of registers is severely limited, so registers are allocated by the compiler according to its needs. You don’t have direct control, nor do you see any evidence in your programs that registers even exist.The stack. This lives in the general random-access memory (RAM) area, but has direct support from the processor via its stack pointer. The stack pointer is moved down to create new memory and moved up to release that memory. This is an extremely fast and efficient way to allocate storage, second only to registers. The Java compiler must know, while it is creating the program, the exact size and lifetime of all the data that is stored on the stack, because it must generate the code to move the stack pointer up and down. This constraint places limits on the flexibility of your programs, so while some Java storage exists on the stack—in particular, object references—Java objects themselves are not placed on the stack. The heap. This is a general-purpose pool of memory (also in the RAM area) where all Java objects live. The nice thing about the heap is that, unlike the stack, the compiler doesn’t need to know how much storage it needs to allocate from the heap or how long that storage must stay on the heap. Thus, there’s a great deal of flexibility in using storage on the heap. Whenever you need to create an object, you simply write the code to create it by using new, and the storage is allocated on th e heap when that code is executed. Of course there’s a priceyou pay for this flexibility. It takes more time to allocate heap storage than it does to allocate stack storage (if you even could create objects on the stack in Java, as you can in C++). Static storage. “Static” is used here in the sense of “in a fixed location” (although it’s also in RAM). Static storage contains data that is available for the entire time a program is running. You can use the static keyword to specify that a particular element of an object is static, but Java objects themselves are never placed in static storage.Constant storage. Constant values are often placed directly in the program code, which is safe since they can never change. Sometimes constants are cordoned off by themselves so that they can be optionally placed in read-only memory (ROM), in embedded systems.Non-RAM storage. If data lives completely outside a program, it can exist while the program is not running, outside the control of the program. The two primary examples of this are streamed objects, in which objects are turned into streams of bytes, generally to be sent to another machine, and persistent objects, in which the objects are placed on disk so they will hold their state even when the program is terminated. The trick with these types of storage is turning the objects into something that can exist on the other medium, and yet can be resurrected into a regular RAM-based object when necessary. Java provides support for lightweight persistence, and future versions of Java might provide more complete solutions for persistenceOne group of types, which you’ll use quite often in your programming, gets special treatment. You can think of these as “primitive” types. The reason for the special treatment is that to create an object with new—especially a small, simple variable—isn’t very efficient, because new places objects on the heap. For these types Java falls back on the approach taken by C and C++. That is, instead of creating the variable by using new, an “automatic” variable is created that is not a reference. The variable holds the value, and it’s placed on the stack, so it’s much more efficient.Java determines the size of each primitive type. These sizes don’t change from one machine architecture to another as they do in most languages. This size invariance is one reason Java programs are portableJava编程思想“尽管以C++为基础,但Java是一种更纯粹的面向对象程序设计语言”。

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)。

Java外文文献翻译

Java外文文献翻译

Java外文文献翻译摘要Java是一种面向对象的高级程序设计语言,具有良好的跨平台性和可扩展性。

本文翻译了一篇英文文献,介绍了Java 语言的特点、历史背景以及它在计算机科学领域中的应用。

引言Java是由James Gosling和他的团队于上世纪90年代初开发的一种面向对象编程语言。

Java的设计初衷是为了解决嵌入式系统中的问题,但随着时间的推移,它渐渐被广泛应用于Web应用开发、移动应用开发以及大数据处理等领域。

特点Java具有以下几个主要特点:1.跨平台性:Java虚拟机(JVM)使得Java代码可以在不同的平台上运行,无需针对特定操作系统进行编译。

这一特点使得Java成为一种非常适合开发跨平台应用的语言。

2.可扩展性:Java的设计允许开发者通过编写自定义类库实现功能的扩展。

这种可扩展性使得Java成为一种非常灵活的语言,可以满足不同应用领域的需求。

3.面向对象:Java采用面向对象的编程范式,它支持封装、继承和多态等特性。

面向对象的编程范式使得Java 代码更易于组织、理解和维护。

4.良好的性能:Java虚拟机通过即时编译和垃圾回收等技术来提高运行时的性能。

这使得Java成为一种可靠且高效的编程语言。

历史背景Java的设计始于1991年,当时James Gosling和他的团队正在开发一种用于嵌入式系统的语言。

最初的设计称为Oak,后来在1995年更名为Java。

当时,互联网开始崭露头角,Sun Microsystems(Java的创始公司)意识到嵌入式系统的语言可能无法满足未来互联网应用的需求,于是将Oak重新设计为面向Web的语言。

Java的发布引起了广泛关注,并以其跨平台特性和安全性而闻名。

应用领域Java在计算机科学领域中有着广泛的应用。

以下是几个主要的应用领域:1.Web应用开发:Java支持开发基于Java Servlet和JavaServer Pages(JSP)的Web应用。

(完整word版)JAVA外文文献+翻译

(完整word版)JAVA外文文献+翻译

燕山大学本科生毕业设计(翻译)1 Java and the InternetIf Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionarystep in computer programming. The answer isn ’t immediately obvious if you coming from a traditional programming perspective. Although 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 in itial 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 f or 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 the data on the form or“submit ”on the form back to the server. This submission passes t hrough 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 program located on the server in a directory that ’s typically called “-bin.” (If you watch the address w indow at the top of your browser when you push a button on a Web page, you can sometimes see “cgi -bin ” within all the gobbledygook 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。

Java编程思想(Java和因特网)毕业论文外文文献翻译及原文

Java编程思想(Java和因特网)毕业论文外文文献翻译及原文

毕业设计(论文)外文文献翻译文献、资料中文题目:Java编程思想 (Java和因特网)文献、资料英文题目:Thingking in Java(Java and the Internet)文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期: 2017.02.14文献来源:Bruce Eckel.Thinking in Java [J]. Pearson Higher Isia Education,2006-2-20.Java编程思想 (Java和因特网)既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。

Java除了可解决传统的程序设计问题以外,还能解决World Wide Web(万维网)上的编程问题。

1、客户端编程Web最初采用的“服务器-浏览器”方案可提供交互式内容,但这种交互能力完全由服务器提供,为服务器和因特网带来了不小的负担。

服务器一般为客户浏览器产生静态网页,由后者简单地解释并显示出来。

基本HTML语言提供了简单的数据收集机制:文字输入框、复选框、单选钮、列表以及下拉列表等,另外还有一个按钮,只能由程序规定重新设置表单中的数据,以便回传给服务器。

用户提交的信息通过所有Web服务器均能支持的“通用网关接口”(CGI)回传到服务器。

包含在提交数据中的文字指示CGI该如何操作。

最常见的行动是运行位于服务器的一个程序。

那个程序一般保存在一个名为“cgi-bin”的目录中(按下Web页内的一个按钮时,请注意一下浏览器顶部的地址窗,经常都能发现“cgi-bin”的字样)。

大多数语言都可用来编制这些程序,但其中最常见的是Perl。

这是由于Perl是专为文字的处理及解释而设计的,所以能在任何服务器上安装和使用,无论采用的处理器或操作系统是什么。

JAVA学习过程论文中英文资料对照外文翻译文献

JAVA学习过程论文中英文资料对照外文翻译文献

JAVA学习过程论文中英文资料对照外文翻译文献Java Learning Path processEach person's study method is different, a person's method suits another person not necessarily, I only can discuss own study method. Because I study Java am study independently completely, has not asked others, therefore the study process basically is completely oneself tries to find out. I did not know whether this method is the quite good method, only could give everybody to provide refers.Studies Java first step installs good JDK, writes Hello World? Actually the JDK study is not so simple, has two questions about JDK is very easy to puzzle the Java programmer continuously the place: Is the CLASSPATH question, actually said from the principle, is how must make clear JRE ClassLoader increase Class; Another question is package and the import question, how seeks the kind of way question. These two questions tried to find out clear, eliminated has studied Java and uses JDK the biggest barrier. The recommendation looked Wang Sen "the Java Depth Experiences dangers", has carried on the thorough discussion to these two questionsSecond step is studies Java the grammar. The Java grammar is kind of C++, the basically mainstream programming language is not kind of C, is kind of C++, does not have what new thing, therefore the grammar study, probably was the quite a while time is enough. Only needs to pay attention is has the key words usage which several is not easy to make clear, public, protected, private, static, when uses, why has to use, how uses, this possible need some people to direct, I initially was own ponder over completely, has spent the very long time. But afterwards I saw above this book spoke these concepts to "Thinking in Java".Third step is studies Java the object-oriented programming language characteristic place. For instance inherits, structure, abstract class, the connection, the method are many condition, heavy load, cover, Java exception handling mechanism. Said regarding a not object-oriented language background person that, I thought this process needs to spend the very long very long time, because studies in front of Java does not have C++ the experience, only then the C experience, I was have probably spent for a month, all made clear only then thoroughly these concepts, book example above repeatedly estimating, the revision, the attempt, repeatedly looked at that several chapter of contents, looked, looked has not gotten down 5, comprehended only then thoroughly. But I thought if has the C++ experience, should 12 days time be enough. Then in this process, may have a look "Thinking in Java" this book, opposite is extremely thorough to the object explanation. What a pity is I studies, has not seen to this book, therefore own have spent the massive time, and estimates through own attempt learns.Fourth step starts a familiar Java kind of storehouse. The Java foundation class storehouse actually is JDK installs under the table of contentsjre\Lib\Rt.Jar this package. The study foundation class storehouse studies rt.Jar. Inside the foundation class storehouse kind are extremely extremely many. It is said some more than 3,000, I have not counted. But said the most core truly regarding us only then 4, respectively isng.*;Java.Io.*;Java.Util.*;Java.Sql.*;These four packages study, each package study all may write thick teaching material, but O'reilly also truly is does this. I thought if time quite tight, is impossible through to read four books to study. I thought the quite good study method is such:First must read through entire package the frame, understood entire package class, interface, the exception constitution, should better be can find the introduction entire package frame the article. These introduced specially package of books the first several chapters should be these overall frame content introductions. Is not must be familiar with each kind of usage to the package of overall frame assurance, which attributes remembers it have, the method. Wants to record also cannot remember. But is must know which aspects the package does have a kind of constitution, these kind of uses are any, most core several classifications maybe complete any function. I in the time which trains to the human generally is a class speaks a package, therefore not impossible detailed introduction each kind of usage, but I repeatedly stress, how do I speak these packages to you am must tell you a kind of method am transfer, also does not request you to remember the kind of method transfer, but wants you tounderstand, which kinds Java has provided to us, each kind is uses in any situation, when I meet the question the time, I knew which kind, or which several kind of combinations can solve my problem, That'all! When we write the procedure specifically time, so long as you knew which kind should complete your work with to be enough. Codes, the concrete method transfer, writes the code, Documentation, all things all inside Documentation, will not request you certainly to remember, are actual you also not to be able to remember more than 3,000 kinds altogether the nearly 100,000 methods transfers. Therefore changes to each package overall frame assurance extremely importantly.Fifth step, through above study, if study the quite solid speech, built the Java foundation, is left over the work which had to do is sweeps clean inside Documentation besides above 4 packages other some comparisons to have the use the kind. Believed progressed to this step, Java studies independently the ability already to raise, might to study Documentation directly horizontal. Besides must make the GUI programming, inside JDK other can have the use the package is these:Java.Text.*;.*;Javax.Naming.*;These packages of inside real correct uses quite many kinds very are actually few, only then several, therefore does not need to spend the very much time.Sixth step, Java Web programmingThe Web programming core is the HTTP agreement, the HTTP agreement and Java irrelevant, if not familiar HTTP agreement, although also may learnServlet/JSP programming, but cannot achieve extrapolates, by knowing one method you will know all boundary. Therefore the HTTP agreement study is necessary. If has been familiar with HTTP agreement, also had the Java programming good foundation, studies Servlet/JSP is simply easy as pie, I study Servlet/JSP has used not to week-long time, then started with JSP to make the project. In Servlet/In the JSP study, heavy still was Servlet Documentation. Servlet the API most commonly used kind are very few, the flowered quite few time might grasp. These kinds all looked at, writes several examples to try. Servlet/The JSP programming essence is transferring these kinds to come repeatedly through the HTTP agreement converses between Web Server and Brower. Moreover to JSP, but also needs to be familiar with several commonly used JSP the mark, the concrete mode of writing cannot remember the speech, looks up temporarily and that's the end of.In addition Java the Web programming study must place Web Application with emphasis in the design pattern, how carries on the service logic the analysis, and carries on the reasonable design, according to the MVC design pattern request, completes the different logical level separately using Servlet and JSP, how grasps carries on the flow between Servlet and JSP the control and data sharing, as well as how Web should Application dispose and the deployment.Seventh step, J2EE programmingThe above study process if is quite smooth, carries on to this step, the difficulty enhances suddenly. Because the above knowledge content all only involves an aspect, but likes EJB, JMS, core the and so on JTA J2EE standard often is several kind of Java technology synthesis utilization crystallization, therefore grasps the difficulty quite to be big.First certainly must study good JNDI, JNDI is App the Server localization server resources (the EJB module, Datasouce, JMS) searches the method, if to JNDI not familiar, EJB, JMS these things cannot study nearly. JNDI actually is javax.Naming.* This package, utilizes is very simple. The difficulty lies in the server resources document the disposition. Regarding the server resources document disposition, needed to have a look the special documents to be standard, for instance web.Xml mode of writing, ejb-jar.Xml mode of writing and so on. In view of each kind of different App Server, but also has own service resources disposition document, also is needs to be familiar with.Then may study JTA, mainly is must understand JTA regarding business control method, as well as should use JTA in any situation. Here may simple cite an example, we knew the ordinary circumstances may carry on business regarding a database connection (conn.SetAutoCommit (false)....,mit ()), does is an atomic operation, but the supposition my service demand is needs to hold artificially to two different databases is an atomic operation, you can do to? At this time only could use JTA. The supposition operating process inserts a record first toward the A database, then deletes the B database another record, we wrote the code are cannot control entire hold artificially are an atomic operation. With the JTA speech, completes the control by App Server.In studies in front of EJB must study the object sequence and RMI, RMI is the EJB foundation. Then studies JMS and EJB, said regarding EJB, most is essential is must understand how EJB is realizes through RMI to the far-end object transfer, as well as must use in any situation to EJB.In studies EJB, after JMS these things, you possibly can realize must extremely anxiously study two domains the knowledge, is UML, another isDesign Pattern. The Java enterprise software design takes the frame extremely (Framework) the design, a good software frame is the software develops the successful essential condition. In this time, should start the study key point to place the design pattern and in the frame study, experiences through the study and the actual programming grasps EJB the design pattern and the J2EE core pattern.Inside J2EE standard, except EJB, JMS, JTA, Servlet/JSP, outside JDBC also has the very many very many enterprises technology, here 11 did not carry on introducedMoreover also has newest domain Web Services. Web Services also completely does not have any new thing, it likes is one kind of adhesive, may unify the different service provides a unified transfer connection, said as the user, I so long as obtain the service provider for mine WSDL (to service description), has sufficed, I did not know completely the server tenderer provides actually the service is the EJB module,The Net module, any CORBA module, other any realizations, I do not need to know. Web the Services greatest place lies in through the unified service provides the way and the transfer way, has realized the entire Internet service sharing, is an extremely excited area of technology. Web Services resembles at present not to have any very good books, but may through look up the material above the network the way to study.JA V A学习过程每个人的学习方法是不同的,一个人的方法不见得适合另一个人,我只能是谈自己的学习方法。

Web应用中英文对照外文翻译文献

Web应用中英文对照外文翻译文献

Web应用中英文对照外文翻译文献(文档含英文原文和中文翻译)外文:A Comparative Study of Web Application Design ModelsUsing the Java TechnologiesAbstract.The Servlet technology has been the most widely used technology for building scalable Web applications. In the events, there are four design models for developing Web applications using the Java technologies: Model 1, Model2, Struts, and JavaServer Faces (JSF). Model 1 employs a series of JSP pages; Model 2 adopts the Model-View-Controller pattern; Struts is a framework employing the Model 2 design model; and JSF is a new technology that supports ready-to-use components for rapid Web application development. Model 1 is not recommended for medium-sized and large applications as it introduces maintenance nightmare. This paper compares and evaluates the ease of application development and theperformance of the three design models (Model 2, Struts, and JSF) by building three versions of an online store application using each of the three design models, respectively.1 IntroductionToday, Web applications are the most common applications for presenting dynamic contents. There are a number of technologies for building Web applications, the most popular of which is the Servlet technology . This technology gains its popularity from its superiority over other technologies such as CGI and PHP .Servlets are cumbersome to develop, however, because sending HTML tags requires the programmer to compose them into a String object and send this object to the browser. Also, a minor change to the output requires the servlet to be recompiled. To address this issue, Sun Microsystems invented JavaServer Pages (JSP) . JSP allows HTML tags to be intertwined with Java code and each page is translated into a servlet. A JSP page is a servlet. However, compilation occurs automatically when the page is first requested. As a result, changing the output does not need recompilation. In addition, JSP enables the separation of presentation from the business logic through the use of JavaBeans and custom tag libraries. The norm now in developing Javabased Web applications is to use servlets along with JavaServer Pages.In the later development, there are a number of design models for building servlet/JSP applications: Model 1, Model 2, Struts , and JSF . Model 1 and Model 2 were first mentioned in the early specifications of JSP. Model 1 strictly uses JSP pages, with no servlets, and Model 2 uses the combination of both servlets and JSP pages. The terms of Model 1 and Model 2 have been used ever since. Model 1 is suitable for prototypes and very small applications, and Model 2 is the recommended design model for medium sized and large applications.As Model 2 gained more acceptances in the industry, an open source initiative to build the Struts Framework was initiated. Struts perfects Model 2 by providing the controller part of the Model-View-Controller of Model 2. In addition, Struts provides better page navigation management and several custom tag libraries for more rapid development. Despite its steep learning curve and the fact that it wasnever defined in any specification, Struts has been gaining popularity as the alternative to Model 2.JavaServer Faces is built under the Java Community Process under JSR-127.Sun Microsystems proposed this technology in the hope that JSF will be the ultimate model for building Java Web applications. The most important feature of JSF is the availability of ready-to-use components such as extensible UI components, easy page navigation, input validators, data converters and JavaBeans management.The problem facing servlet/JSP programmers are to choose the most appropriate design model. Clearly, JSF provides a better solution in regard to development time. However, some people are not sanguine to adopt this technology for fear of performance penalty due to the overhead of the JSF implementation.We build three versions of an online store application named BuyDirect using Model 2, Struts and JSF. The parameters compared are the number of lines of code, the number of classes, and the performance measurement results. We investigate which of the design models allows the most rapid development process. We evaluate the performances of the applications built upon these models. We provide some suggestions to perfect the existing design models to make development more rapid.The rest of the paper is organised as follows. Section 2 discusses the issues in Web development. Section 3 explains how the three design models address these development issues. Section 4 provides the details of the hardware and software used in these experiments. Section 5 presents the experiment results and analysis. Section 6 reviews the related work. Section 7 concludes by offering some suggestions to improve the existing design models.2 Java Web Development IssuesAll Java Web development uses the Servlet technology as the underlying technology. As such, all Java Web applications have certain issues that need to be addressed:User Interface. The user interface is what the client browser renders as HTMLtags. Any server-side component used in the application must be encoded into the corresponding HTML elements. Besides for displaying the content and data, the user interface is also responsible in receiving input from the user.●Input Validation. User input needs to be validated. There are two types of inputvalidation, server-side and client-side. As the name implies, the server-side input validation is performed on the server after the input reaches the server.Client-side input validation is done on the browser, usually by using JavaScript or other scripting languages. The advantages of using client-side input validation are prompt response and reducing the server workload. The server-side input validation should always be performed regardless the presence of client-side validation because there is no guarantee the user browser's scripting feature is being on and malicious users can easily work around client-side validation.●Model Objects. Model objects in Java-based Web applications are in the formsof JavaBeans. Model objects make up the Model part of the MVC based design model. A model object can be used to bind a component value to be used at a later stage. In addition, it can encapsulate business logic required for processing.●Page Navigation. Almost all Web applications have multiple pages that the usercan navigate from one to another. All MVC-based design models use a servlet as the Controller part. This servlet also acts as the sole entry point to the application. Which page to be displayed after the current request is determined by the value of a specified request parameter. Managing page navigation is critically important.3 Web Application Design ModelsThe Model 2 design model is based on the Model-View-Controller (MVC) design pattern. As explained by Burbeck , there are three main modules in MVC, the Controller, the View, and the Model. The Controller acts as the central entry point to the application. All user interactions go through this controller. The View contains the presentation part of the application, and the Model stores data or encapsulates business logic of the application. In the later development, the StrutsFramework provides a common framework to easily build Model 2 applications. Then, the last initiative is the JavaServer Faces, which also employs the MVC design pattern.In the following sections, we discuss these three design models and explain how each design model addresses the development issues specified in the previous section.3.1 Model 2A Java Web application that is based on the Model 2 design model has one servlet(called the Controller servlet) that serves as the Controller part. All requests are first handled by this servlet, which immediately dispatches the requests to the appropriate views using RequestDispatcher objects. Views in the Model 2 design model are represented by JSP pages. To store data, a Model 2 application uses JavaBeans, which are the Model part of the application. In addition to storing data, the JavaBeans also encapsulate business logic. Each HTTP request carries an action parameter that indicates which view to dispatch this request to. The programmer must code the HTML tags for user interface in all JSP pages in the application and write input validation code. In addition, the model objects are managed by individual JSP pages.3.2 StrutsThe Struts Framework is an improvement of the Model 2 design model. It provides a default Controller servlet so that the user does not have to write and compile one. Struts alleviates the task of page navigation by allowing navigation rules to be present in its application configuration file (an XML document). Changes to the navigation rules do not require recompilation of a Java servlet class. In addition to easier page navigation, Struts provides custom tag libraries that define tags representing HTML elements. One of these tags is used for error handling and Struts is therefore capable of displaying localized error messages in support for internationalization. Struts applications use JavaBeans as their models, just like the Model 2 design model. In addition, Struts programmers have to write their own input validation code.3.3 JSFJSF also employs a controller servlet that is called FacesServlet. This servlet is the only entry point to a JSF application. JSF also uses JSP pages as its views and JavaBeans as its model objects. Unlike Model 2 and Struts, however, JSF provides ready-to-use user interface components that can be written on JSP pages. Upon an invocation of a page of a JSF application, the FacesServlet constructs a component tree that represents the JSP page being requested. Some of the components can also trigger events, making JSF event-driven. For page navigation, JSF uses an approach similar to Struts, i.e., by allowing navigation rules to be defined in an application configuration file (again, an XML document).What distinguishes a JSF application from non-JSF servlet/JSP application is that JSF applications are event-driven. The user interface of a JSF application is one or many JSP pages that host Web components such as forms and input boxes. These components are represented by JSF custom tags and can hold data. A component can be nested inside another, and it is possible to draw a tree of components. Just as in normal servlet/JSP applications, you use JavaBeans to store the data the user entered.4 Function EnvironmentThe software and hardware details for our experiments are described below.4.1 The Servlet ContainerA Java Web application runs in a servlet container, which is the engine that processes the incoming HTTP requests for the resources in the application. For this research project, we use Tomcat, an open source servlet container from the Apache Software Foundation. The version we use is 6.0.Basically, a servlet container processes a servlet by performing the following tasks:- Creating the HttpRequest Object- Creating the HttpResponse Object- Calling the service method of the Servlet interface, passing the HttpRequest and HttpResponse objects.4.2 Testing ClientsFor performance testing, we emulate multiple users using JMeter 1.9 , also from the Apache Software Foundation. JMeter allows the user to choose the number of threads to perform testing. Each thread emulates a different user. JMeter also lets us choose how many times a test will be done. To test a Web application using JMeter, you direct requests to certain IP address, context path, and port number. You can also specify request parameters to be included in each HTTP request. As the output, JMeter notifies the response time of the server in milliseconds for a test. From the response time, we derive the number of hits/seconds the server is capable of serving.4.3 HardwareWe use different computers for running the applications and for testing, so as to obtain maximum performance measurement accuracy. The computer running the application is a XP machine having the following hardware specifications: Intel Core 1GHz CPU with 1G RAM. The computer running the testing clients is a Windows 2000 machine running JMeter. The computer has the following specifications: Intel Core 1GHz CPU with 1G RAM.5 ResultsWe obtain experimental results in two categories: the ease of development and performance. The ease of development category compares the number of classes and the number of lines of code. These numbers indicate how easy it is to develop an application by following a certain design model. An application with the fewer number of classes or the number of lines of code indicates that the application is relatively easier to build. The application with the more number of classes indicates that the application takes more time to develop.The performance measurement results are obtained by comparing two operations. The Search operation is the most common operation in such an application,and the Browse operation.5.1 Ease of Application DevelopmentAs Table 1 shows, it takes the most effort to implement the Model 2 design model. Using Struts alleviates the problem a bit, and the best saving in the development comes if one uses JSF.Table 1. The number of classes and the number of lines for the applications under studyThe Model 2 design model is characterised by the presence of a Controller servlet and a number of JavaBeans classes (as the Model) and JSP pages (as the Views). The Controller servlet is responsible for page navigation rules that employ a series of if statements. Model 2 application programmers must also code for the input validation that in this research is implemented inside a number of custom tag libraries. The other classes in the Model 2 design model are custom tag library and the tag library descriptors responsible for input validation and data display. In fact, input validation takes 590 lines of code, or almost 30% of the total amount of code.In the Struts application, the Controller servlet is provided by the framework, therefore a Struts programmer saves time for not having to write one. However, he/she still needs to write page navigation rules in the Application Configuration file, which is easier than writing a servlet because the Application Configuration file can be edited using a text editor and no compilation is necessary. Input validation must still be done manually, even though the Struts Framework provides an error handling mechanism. The number of classes and the number of lines of code for input validation are almost similar to the Model 2 application. In Struts, the other classes are Action classes to which the default Controller servlet dispatches requests.In JSF input validation comes free through the availability of validatorcomponent. As a result, a JSF application developer can skip this task. In addition, page navigation takes the same course as Struts, i.e. by utilising an Application Configuration file. The other classes in JSF are a ContextListener, an ActionListener, and a Database utility class.5.2 Performance MeasurementFor each operation, we measure the server response time (in milliseconds) for 1 to 10 concurrent users. The number of users is specified by setting the number of threads in Jmeter. Each test is conducted 10 times and the average is taken. Each operation is discussed further is the following sub-sections.5.2.1 Search OperationThe Search operation whose name or description matches the keyword. There is one SQL SELECT statement performed. Figure 2 compares the three versions of applications for the Search operation.Fig. 2. The performance comparison for the Search operation For the Model 2 application, the average server response time for one user is 173 ms and for 10 users is 919 ms. For the Struts application, these numbers are 189 ms and 900 ms, respectively. For the application built using JSF, the average server response time is 210 ms for one user and 932 ms for 10 users. The increase of the response time is proportional to the increase of the number of concurrent users, which means that the server is still able to cope with the load.The Model 2 application has the least overhead, therefore the averageperformance should be better than the Struts and JSF applications. However, the Struts application performs as well as the Model 2 application. This is because the server has enough memory to load all Struts libraries required to run Struts. Also, note that page navigation rules in Struts are loaded and stored in an object called ActionMapping. Therefore, given an action request parameter, the next page of navigation is obtained through a look-up. On the other hand, the Model 2 application uses a series of if statements to find the next page of navigation, given the action request parameter.The JSF application performs slightly worse than the other applications in almost all numbers of concurrent users. This could be due to the time taken by the JSF implementation to construct a component tree for each page requested. However, the difference in server response time between JSF and other applications is not that significant.5.2.2 Browse OperationThe Browse operation,like the Search operation, there is one SQL SELECT statement performed. Figure 3 gives the test results for this operation.Fig. 3. The performance comparison for the Browse operation On average, the Model 2 application performs the best because it has the least overhead. The average server response time is 111 ms for one user and 899 ms for 10 users. The Struts application has comparable performance, with one user average server response time of 180 ms and 10 user response time of 920 ms. The JSF lacks a bit behind the two applications with these numbers being 190 and 1009ms respectively. The increase of the server response time is proportional to the increase of the number of concurrent users, which means the server is able to serve those users well. The average performance measurement results of the Browse operation are very similar to the ones for the Search operation because the database operations of both operations are also similar.6 Related WorkCompare the performance of database-based Web applications using Java servlets, PHP version 3, and Common Gateway Interface (CGI). After a series of benchmark tests that performs data retrieval from a MySQL database, find that the solution of Java servlets with persistent database connection has the best performance. PHP3 using persistent database connections performs fairly well when compared to the CGI solution,also mention the advantages of using Java servlets. According to these authors. Java servlets are an excellent choice to meet the requirement of e-commerce (such as online shopping) applications and are able to handle client requests in a highly interactive mode.Comparing PHP 4, Java servlets, and Enterprise JavaBeans. Measure the performance of these three architectures using two applications. Study reveals that PHP4 is more efficient than Java servlets, and the EJBs perform even worse than servlets. However, note that servlets, being part of the Java solution, provides the flexibility of being able to be ported to another system with a different operating system.7 ConclusionWe find that it is most rapid to build Web applications using JSF. Model 2 applications are the least rapid but give the best performance. Struts applications sit in the middle of the other two design models in both comparisons.We make some suggestions that could improve the Servlets technology in general and enhance the performance of applications based on both design models. Struts. Struts is not based on any specification and there is no documentation that discusses its internal working. Therefore, it is hard to know what have been implemented and what could be improved.●The Servlets Technology. The Servlet 2.3 Specification does not define anycaching mechanism. There is no mention of caching in the upcoming Servlet2.4 Specification either. Despite the dynamic nature of the content of a Webapplication, some contents do not change very often. For example, the categories of products that a user can browse in an online store application probably only change once in a month. If those semi-static contents must be generated from the database every time they are requested, a lot of programming resources will be wasted. Servlet programmers get around the absence of caching by writing an object that caches certain content. However, since there is no standard for caching, many programmers write the same piece of code again and again.●Model 2.The main drawback is that the page navigation rules are hard-coded inthe Controller servlet. This means any minor change to the program flow will require the Controller servlet to be re-compiled. The solution to this problem is to provide a mapper that reads the page navigation rules when the application starts. The code could be conveniently written in the init method of the Controller servlet. This method is only executed once, i.e. the first time the servlet is loaded into memory. If the properties file needs to be re-read every time it changes, the programmer can check the timestamp of the properties file for each request, and compares it with the previous read of this file. If the timestamp is more current than the previous read, the mapper can be re-constructed. This feature can be enabled and disabled by using an initial parameter in the Context object. At the development phase, this feature should be enabled. At deployment, this feature should be off. The use of the properties file to store the page navigation rules also makes it possible to avoid a series of if statements in the Controller Servlet, which can be time-consuming for every request. Instead, a HashMap can be used, with action request parameters as keys and the next JSP pages as values. The other disadvantage of this design model is the absence of standard components for input validation and user interface. However, this has been solved in JSF.●JSF. JSF provides solutions to common problems in Web development, such aspage navigation management, UI components and input validators. However, because this technology is still very young, there are not too many UIcomponents available, forcing programmers to combine JSF with non-JSF servlets/JSP pages. JSF is event-driven. JSF programmers determine the behavior of a JSF application by writing event listeners, just like those listeners in a Swing application. In JSF version 1.0, there are currently two types of events that can be triggered: ActionEvent and ValueChangedEvent. However, this is good enough to provide sufficient level of interactivity between the application and its users. Adding more types of events will definitely make JSF more appealing.References[1].Cecchet, E., Chanda A., Elnikety S., Marguerite J., Zwaenepoel W.: Performance Comparison of Middleware Architectures for Generating Dynamic Web Content. Proceeding of the 4th International Middelware Conference, 2003.[2].Cecchet, E., Marguerite, J., and Zwaenepoel, W.: Performance and Scalability of EJB Applications. Proceedings of OOPSLA’02, 2002.[3].Wu, A., Wang, H., and Wilkins, D.: Performance Comparison of Alternative Solutions for Web-To-Database Applications. Proceedings of the Southern Conference on Computing, the University of Southern Mississippi, 2000.基于Java技术的Web应用设计模型的比较研究摘要Servlet技术在建立可扩展性Web应用中是被应用最广泛的技术。

JAVAWeb外文文献毕业设计

JAVAWeb外文文献毕业设计

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 Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, on the market at inside of 85% server product.This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the bookof consult the homologous JSP.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 introductionto it.JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matterswhich you choose.JSP provides the following benefits over servlets alone:• It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.• You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.•You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTMLand 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 complete your toolkit.SOURCE OF JSPThe technique of JSP of the company of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to design to turn the end page with format. Use the perhaps small script future life of marking of JSP becomes the dynamic state on the page contents.( the contents changes according to the claim of)The Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can complete, this name of Servlet comes from the Applet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but don't do any translation, if reader would like to, can call it as" small service procedure". The Servlet is similar to traditional CGI, ISAPI, NSAPI etc. Web procedure development the function of the tool in fact, at use the Java Servlet hereafter, the customer need not use again the lowly method of CGI of efficiency, also need not use only the ability come to born page of Web of dynamic state in the method of API that a certain fixed Web server terrace circulate. Many servers of Web all support the Servlet, even not support the Servlet server of Web directly and can also pass the additional applied server and the mold pieces to support the Servlet. Receive benefit in the characteristic of the Java cross-platform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is complete to have nothing to do with terrace and isto 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 lightheartedlyinterjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, Cold Fusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even usedmany 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 like the SSJS, it also allows you carry the static state HTML contents and servers the script mix to put together the born dynamic state exportation. JSP the script language that the Java is the tacit approval, however, be like the ASP and can use other languages( such as JavaScript and VBScript), the norm of JSP also allows to use other languages.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 allJavas 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, suchas 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 relatedwith Java.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 webpage 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 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 limitssex 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 notcontrol 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 ofJava 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 automaticallybyte code of Java.Thus, the visitant that is the website requests a JSP page, under the condition of it is not knowing, an already born, the Servlet actual full general that prepared to edit and translate completes all works, very concealment but again and efficiently. The Servlet is to edit and translate of, so the code of JSP in the web page does not need when the every time requests that page is explain. The engine of JSP need to be edit and translate after Servlet the code end is modify only once, then this Servlet that editted and translate can be carry out. The in view of the fact JSP engine auto is born to edit and translate the Servlet also, need not procedure member begins to edit and translate the code, so the JSP can bring vivid sex that function and fast developments need that you are efficiently. Compared with the traditional CGI, the JSP has the equal advantage. First, on the speed, the traditional procedure of CGI needs to use the standard importation of the system to output the equipments to carry out the dynamic state web page born, but the JSP is direct is mutually the connection with server. And say for the CGI, each interview needs to add to add a progress to handle, the progress build up and destroy by burning constantly and will be a not small burden for calculator of be the server of Web. The next in order, the JSP is specialized to develop but design for the Web of, its purpose is for building up according to the Web applied procedure, included the norm and the tool of a the whole set. Use the technique of JSP can combine a lot of JSP pages to become a Web applicationprocedure very expediently.JSP的技术发展历史作者: Kathy Sierra and Bert Bates来源: Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。

Java编程语言外文翻译、英汉互译、中英对照

Java编程语言外文翻译、英汉互译、中英对照

文档从互联网中收集,已重新修正排版,word格式支持编辑,如有帮助欢迎下载支持。

外文翻译原文及译文学院计算机学院专业计算机科学与技术班级学号姓名指导教师负责教师Java(programming language)Java is a general-purpose, concurrent, class-based, object-oriented computer program- -ming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java applications are typically compiled to byte code (class file) that can run on any Java virtual machine(JVM) regardless of computer architecture. Java is, as of 2012, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1991 and first released in 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.Java is a set of several computer software products and specifications from Sun Microsystems (which has since merged with Oracle Corporation), that together provide a system for developing application software and deploying it in across-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones on the low end, to enterprise servers and supercomputers on the high end. While less common, Java appletsare sometimes used to provide improved and secure functions while browsing the World Wide Web on desktop computers.Writing in the Java programming language is the primary way to produce code that will be deployed as Java bytecode. There are, however, byte code compilers available forother languages such as Ada, JavaScript, Python, and Ruby. Several new languages have been designed to run natively on the Java Virtual Machine (JVM), such as Scala, Clojure and Groovy.Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C. Java eliminates certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.An edition of the Java platform is the name for a bundle of related programs from Sun that allow for developing and running programs written in the Java programming language. The platform is not specific to any one processor or operating system, but rather an execution engine (called a virtual machine) and a compiler with a set of libraries that are implemented for various hardware and operating systems so that Java programs can run identically on all of them. The Java platform consists of several programs, each of which provides a portion of its overall capabilities. For example, the Java compiler, which converts Java source code into Java byte code (an intermediate language for the JVM), is provided as part of the Java Development Kit (JDK). The Java Runtime Environment(JRE), complementing the JVM with a just-in-time (JIT) compiler, converts intermediate byte code into native machine code on the fly. An extensive set of libraries are also part of the Java platform.The essential components in the platform are the Java language compiler, the libraries, and the runtime environment in which Java intermediate byte code "executes" according to the rules laid out in the virtual machine specification.In most modern operating systems (OSs), a large body of reusable code is provided to simplify the programmer's job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependent on any specific operating system, applications cannot rely on any of the pre-existing OS libraries. Instead, the Java platform provides a comprehensive set of its own standard class libraries containing much of the same reusable functions commonly found in modern operating systems. Most of the system library is also written in Java. For instance, Swing library paints the user interface and handles the events itself, eliminatingmany subtle differences between how different platforms handle even similar components.The Java class libraries serve three purposes within the Java platform. First, like other standard code libraries, the Java libraries provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. Second, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily intertwined with the distinctive implementations of each platform. The and java.io libraries implement an abstraction layer in native OS code, then provide a standard interface for the Java applications to perform those tasks. Finally, when some underlying platform does not support all of the features a Java application expects, the class libraries work to gracefully handle the absent components, either by emulation to provide a substitute, or at least by providing a consistent way to check for the presence of a specific feature.The success of Java and its write once, run anywhere concept has led to other similar efforts, notably the .NET Framework, appearing since 2002, which incorporates many of the successful aspects of Java. .NET in its complete form (Microsoft's implementation) is currently only fully available on Windows platforms, whereas Java is fully available on many platforms. .NET was built from the ground-up to support multiple programming languages, while the Java platform was initially built to support only the Java language, although many other languages have been made for JVM since..NET includes a Java-like language called Visual J# (formerly named J++) that is incompatible with the Java specification, and the associated class library mostly dates to the old JDK 1.1 version of the language. For these reasons, it is more a transitional language to switch from Java to the .NET platform, than a first class .NET language. Visual J# was discontinued with the release of Microsoft Visual Studio 2008. The existing version shipping with Visual Studio 2005will be supported until 2015 as per the product life-cycle strategy.In June and July 1994, after three days of brainstorming with John Gage, the Director of Science for Sun, Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt, the team re-targeted the platform for the World Wide Web. They felt that with the advent of graphical web browsers like Mosaic, the Internet was on its way to evolving into the samehighly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small browser, Web Runner (named after the movie Blade Runner), later renamed Hot Java.That year, the language was renamed Java after a trademark search revealed that Oak was used by Oak Technology. Although Java 1.0a was available for download in 1994, the first public release of Java was 1.0a2 with the Hot Java browser on May 23, 1995, announced by Gage at the Sun World conference. His announcement was accompanied by a surprise announcement by Marc Andreessen, Executive Vice President of Netscape Communications Corporation, that Netscape browsers would be including Java support. On January 9, 1996, the Java Soft group was formed by Sun Microsystems to develop the technology.Java编程语言Java是一种通用的,并发的,基于类的并且是面向对象的计算机编程语言,它是为实现尽可能地减少执行的依赖关系而特别设计的。

Java技术与Web设计外文文献翻译

Java技术与Web设计外文文献翻译

文献信息文献标题:A Comparative Study of Top Web Design Models that are using Java Technologies(使用Java技术的顶级Web设计模型的比较研究)文献作者及出处:Sathyaseelan B, Cordova R S. A Comparative Study of Top Web Design Models that are using Java Technologies[J].International Journal of Innovations and Advancement in Computer Science. 2016,5(5):41-44字数统计:英文1614单词,8806字符;中文2779汉字外文文献A Comparative Study of Top Web Design Models that areusing Java TechnologiesAbstract In today's professional workplace, enterprise applications are complex, adaptable, distributed, part-based, and mission-critical. They might be conveyed as an assortment of platforms across corporate systems, intranets, or the Internet. They are information driven, easy to use, and should meet stringent prerequisites for security, organization, and support. To put it plainly, they are highly complex systems. Various enterprise applications have been in the market today and there are numerous methods available for developing enterprise applications.This paper discusses the major differences between two competing design models for developing Web applications using Java technologies which are Struts and Java Server Faces (JSF). Struts is an open source java framework and is an action-based framework.On the other hand, JSF is a new technology that supports ready-to-use components for rapid Web application development. These two technologies will be analyzed depending on the factors such as the controller flexibility or event handling, navigation, page development, integration and extensibility.Keywords: web design models, Struts, Java Server Faces and Java technologiesI.IntroductionA STRUT is a web application system that has been popular over Java Servlets. It envelops the ordinarily utilized MVC design pattern. A STRUT automates normal tasks, liberating up to explore more of the Action- to-result pages mapping utilizing SML-based configurations. The system makes the progress level subtle elements of the usage of Web-based applications and gives a bit of structural software. JavaServer Faces (JSF) abridges the development of web application user interfaces, usually by defining a user interface component model tied to a well-defined request processing lifecycle. It characterizes a set of UI components— basically, a balanced mapping of the html structure component set along with some extras—that could a be utilized as an application programming interface for extending and modifying standard components or developing new components.II.Key DifferencesThe figures below illustrate the key differences between a STRUTS and JSF request-response scenario. This is necessary in order to fully understand the architecture of each web design models.Figure 1. Struts Request-Response ScenarioIn figure 1, the client sends request to server through a web-browser for aparticular resource. This request is forwarded to the server through a Controller. A servlet goes about as a controller, accepting all requests from the customer. The servlet hands off the request to a different business layer for handling. When processing is finished, the servlet advances or diverts the request to a JSP, which is exclusively in charge of creating the following view for the client. There is no business logic within the JSP.Figure 2. JSF Request-Response ScenarioIn figure 2, the server handles requests from the client, starting from an initial request to a postback request. When a client makes an underlying request for a page, it is asking for the page for the first time. When a client executes a postback, it presents the structure contained on a page that was beforehand stacked into the program as a result of executing an underlying request. When the life cycle handles an underlying request, it just executes the restore view and renders response phases in light of the fact that there is no client information or activities to prepare. Then again, when the life cycle handles a postback, it executes the majority of the phases.III.MethodologyIn this study we will compare JSF and Struts. We will create two modelsemploying the JSF and Struts request-response scenario. JSF is a “component” framework while Struts is an “action” framework.This paper compares and evaluates the ease of application development and the performance of two design models (Struts and JSF) by presenting the two design models and critically analyzes each technology.IV.ChallengesWeb Development ChallengesThe challenges in Web development are much more than the application development. The main challenge is in hosting the application over a webserver and then handling the network issues while accessing those via network. The performances of the web-based application are based on the network availability and its speed. These are not challenges for desktop applications as they run on the local host and the resources are based only on that system.Challenges in STRUTSDespite the fact that Struts accompanies a rundown of remarkable elements however it is important not to neglect the few negative applications about Struts and would require loads of improvements.Greater expectation to learn and adapt - To utilize MVC with STRUTS, you must be alright with the standard JSP, Servlet APIs and a substantial and elaborate system.Poor documentation - Compared to the standard servlet and JSP APIs, STRUTS has less online resources, and some first-time clients locate the online Apache documentation confusing and inadequately sorted out.Less straightforward -With STRUTS applications, there is significantly more going ahead in the background than with ordinary Java-based Web applications which makes it hard to comprehend the system.Challenges in JSFJSF is a very powerful innovation for creating Java-based web applications. It is intended to improve the development of client interfaces for Java Enterprise Edition (Java EE) applications via programmed handling of low level HTTP requests andclient information processing. JSF utilizes a part based model for web advancement. Utilizing the visual JSF web application instrument offered by NetBeans () integrated development environment (IDE), segments can be actually "painted" on a virtual JSF page by relocating them from a palette of JSF segment library.Event handlers can then be characterized for every part the same route concerning creating standalone Java graphical user interface (GUI) application. Route standards are determined for every page from a central XML arrangement document (faces-config.xml). Client activities on a web interface will trigger an event which in return figures out which page is to be shown along the rules specified on that page.This methodology encourages measured and adaptable design, making web application development much more straightforward and faster.The route decides determined for that page. This methodology encourages measured and adaptable configuration, making web application advancement much less difficult and speedier.V.AnalysisIn this study, STRUTS and JSF were analyzed in terms of their controller flexibility or event handling, navigation, page development, integration and extensibility. This is important to compare each web design model and present the advantages and disadvantages of each technology.Controller Flexibility/Event HandlingController is considered as the heart of the Struts. It uses the Front Controller Pattern and Command Pattern. A single servlet takes a request, and then translates HTTP parameters into a Java ActionForm, and passes the ActionForm into a Struts Action class. The URI designates which Action class need to be executed. The Struts framework has one single event handler for the HTTP request. When the request is met by the event handler, the Action returns the result back to the front controller. This in turn will be used to choose the navigation destination.Controller Pattern is been used by the JSF. Each face request goes through asingle servlet, whose responsibility is to get a faces page with components. It will then trigger the events for each component and render the components using a render toolkit. It is also possible to bound the components to the data from its model. JSF have several event handlers on a page while Struts is geared to one event per request. In addition, with Struts, the ActionForms have to extend Struts classes, creating another layer of complicated coding while JSF gives the ability to peg into the model without breaking layering.NavigationNavigation is a key feature of both Struts and JSF. There are 2 types of navigation: static navigation - when the output of a particular page is known so that it is very easy to predict its expected output; and dynamic navigation – when the output is unpredictable and some business logic determines the output of that particular page. Both frameworks have a declarative navigation model and define navigation using rules inside their XML configuration file. Both JSF and Struts support both types of navigation.Page DevelopmentJSF was built with component models which support RAD development, while struts don’t have that support. The Struts framework provides custom libraries to peg into Action Forms and offers some utilities. JSF provides the ability to build components from a variety of view technologies and does it in such a way to be component based.IntegrationStruts are model neutral, so there is no special hook into a model layer. The page data has to be moved from the Action Form to another Model input format which requires heavy complicated coding. The ActionForm class, provides an extra layer of tedious coding and state transition.JSF, on the other hand, encapsulates and hides the details of any data inside the component tree. Data grids and similar rich components can be bound to any Java class. This allows the combination of JSF and SDO which are powerful RAD development.ExtensibilityBoth Struts and JSF offers the extension of framework to meet expanding requirements. Struts have RequestProcessor class that has various callback methods and is the major grip for struts throughout the life-cycle of a request. JSF also have similar functionality to outspread special life-cycle interfaces. Apart from this, JSF totally decouples the render phase from the controller. This considered as on of the main important feature of JSF that Struts does not incorporate.VI.ConclusionJSF is a much more flexible framework while struts is a sturdy framework and works well. JSF is a strong framework because of its flexible controller and navigation. Furthermore, JSF is built with integration and extensibility. From a strategic direction and programming model, JSF can be a target of new applications.中文译文使用Java技术的顶级Web设计模型的比较研究摘要在当今的专业工作环境中,企业应用程序是复杂的、可适应的、分布式的、基于部件的和任务关键的。

【毕业论文】JAVA相关毕业论文外文翻译

【毕业论文】JAVA相关毕业论文外文翻译

【毕业论文】JAVA相关毕业论文外文翻译在当今的计算机科学领域,Java 语言一直占据着重要的地位。

随着技术的不断发展,越来越多的研究成果以英文文献的形式呈现,这使得外文翻译在 Java 相关的毕业论文中变得至关重要。

Java 作为一种面向对象的编程语言,具有许多独特的特性和优势。

例如,它的跨平台性使得开发者能够在不同的操作系统上运行相同的代码,大大提高了程序的可移植性。

在外文文献中,对于 Java 跨平台性的实现原理和技术细节有着深入的探讨。

一篇典型的 Java 相关外文文献可能会涉及到 Java 虚拟机(JVM)的工作机制。

JVM 是 Java 实现跨平台的核心组件,它将 Java 字节码解释或编译为特定平台的机器码。

通过翻译这类文献,我们能够更清晰地理解JVM 如何在内存管理、垃圾回收以及优化执行等方面发挥作用。

在面向对象编程的概念中,Java 的类、对象、继承、多态等特性是研究的重点。

外文文献可能会从更深入的角度分析这些特性的实现方式,以及它们如何影响程序的设计和性能。

例如,关于继承和多态在大型项目中的应用案例和最佳实践,能够为我们提供宝贵的参考。

另外,Java 的并发编程也是一个热门的研究方向。

外文文献中可能包含先进的并发模型、线程同步机制以及并发工具类的详细介绍。

这对于开发高并发、高性能的 Java 应用程序具有重要的指导意义。

在进行外文翻译时,准确理解专业术语是关键。

例如,“synchronization”(同步)、“concurrency”(并发)、“thread pool”(线程池)等术语需要准确无误地翻译,并在上下文中保持一致。

同时,对于复杂的句子结构和长段落,需要仔细分析语法和逻辑关系,以确保翻译的准确性和流畅性。

翻译不仅仅是语言的转换,更是对知识的传递和理解。

对于一些具有特定文化背景或特定行业约定的表述,需要进行适当的解释和说明,以便读者能够更好地理解。

此外,不同类型的 Java 相关外文文献在翻译时也有不同的侧重点。

JAVA外文文献翻译

JAVA外文文献翻译

JAVA外文文献翻译J A V A外文文献翻译Last revision on 21 December 2020中文翻译基于Java技术的Web应用设计模型的比较研究来源:School of Computer Science and Engineering University of New South Wales Sydney, NSW 2052, Australia 作者:Budi Kurniawan and Jingling Xue摘要Servlet技术是在建立可扩展性Web应用中被应用最广泛的技术。

在运用JAVA技术开发Web应用中有四种模型,分别是:Model 1、Model 2、Struts和JavaServer Faces JSF。

Model 1使用一连串的JSP页面,Model 2采用了模型,视图,控制器MVC模式。

Struts是一个采用了Model 2设计模型的框架,JSF是一种支持ready-to-use 组件来进行快速Web应用开发的新技术。

Model 1对于中等和大型的应用来说很难维护,所以不推荐使用。

本文通过利用Model 2、Struts和JSF这三种模型分别构建三个不同版本的在线商店应用程序来比较和评价这三种模型在应用程序开发和性能上的差异。

1.绪论当今Web应用是一种展现动态内容的最普遍的方式。

构建Web 应用有许多种方法,其中最流行的是Servlet技术。

这种技术的流行是因为它比CGI、PHP等其他技术更具优越性。

然而Servlet对于开发来说还是麻烦的,因为它在传送HTML标签时需要程序员将他们组合成为一个字符串对象,再将这个对象传给浏览器。

同样的,对于输出的一个很小的改动也要求Servlet被重新编译。

基于这个原因SUN公司发明了JavaServer Pages JSP技术。

JSP允许HTML标签和Java代码混合在一起,每个页面将被转化为一个Servlet,一个JSP就是一个Servlet,而且编译将在JSP页面第一次被请求时自动进行改变输出也不需要重新编译。

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)。

JAVA外文文献+翻译

JAVA外文文献+翻译

Java and the InternetIf Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionary step in computer programming、The answer isn’t immediately obvious if you’re comin g from a traditional programming perspective、Although 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 in itial 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 the 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 program located on the server in a directory that’s typically called “cgi-bin、” (If you watch the address window at the top of your browser when you push a button on a Web page, you can sometimes see “cgi-bin” within all the gobbledygook 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 ofresponse time、The response of a CGI program depends on how much data must be sent, as well as the load on both the server and 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 nearly impossible to perform with consistency because a GIF be created and moved from the server to the client for each version of the graph、And you’ve no doubt had direct experience 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; you must 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 i s that they aren’t very different from discussions 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 intothe 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 powerful behavior is added to browsers via plug-ins, but writing a plug-in is not a trivial task, and isn’t something you’d want to do as part of the process of building a particular site、The value of the plug-in for client-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 all languages 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 interprets that 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 sophistica ted 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 user interfaces (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 since scripting 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 wit h Java; it’s named that way just to grab some ofJava’s marketing momentum), VBScript (which looks 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 built into both Netscape Navigator and 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 more productive using those scripting languages rather than learning a new one、(You’ll have your hands full dealing with the W eb 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 hard stuff?” 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)、When the applet is activated it executes a program、This is part of its beauty—it provides you with a 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 asmuch 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 to discover that you’ve gotten a date 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 advanta ge a Java applet has over a scripted program is that it’s in compiled form, so the source code isn’t available to the client、On the other hand, a Java applet 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 take 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 you’re experienced with a scripting language you will certainly benefit from looking at JavaScript or VBScript before committing to Java, since they might fit your needs handily and you’ll be more productive sooner、to run its applets withi5、ActiveXTo some degree, the competitor to Java is Microsoft’s ActiveX, although it takes a completely different approach、ActiveX was originally a Windows-onlysolution, although it is now being developed via an independent consortium to become cross-platform、Effectively, ActiveX says “if your program 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、SecurityAutomatically downloading and running programs across the Internet can sound like a virus-builder’s dream、ActiveX especially brings up the thorny issue of security in client-side programming、If you click on a Web site, you might automatically download any number of things along with the HTML page: GIF files, script code, compiled Java code, and ActiveX components、Some of these are benign; GIF files can’t do any harm, and scripting languages are generally limited in what they can do、Java was also designed to run its applets within a “sandbox” of safety, wh ich prevents it from writing to disk or accessing memory outside the sandbox、ActiveX is at the opposite end of the spectrum、Programming with ActiveX is like programming Windows—you can do anything you want、So if you click on a page that downloads an ActiveX component, that component might cause damage to the files on your disk、Of course, programs that you load onto your computer that are not restricted to running inside a Web browser can do the same thing、Viruses downloaded from Bulletin-Board Systems (BBSs) have long been a problem, but the speed of the Internet amplifies the difficulty、The solution seems to be “digital signatures,” whereby code is verified to show who the author is、This is based on the idea that a virus works because its creator can be anonymous, so if you remove the anonymity individuals will beforced to be responsible for their actions、This seems like a good plan because it allows programs to be much more functional, and I suspect it will eliminate malicious mischief、If, however, a program has an unintentional destructive bug it will still cause problems、The Java approach is to prevent these problems from occurring, via the sandbox、The Java interpreter that lives on your local Web browser examines the applet for any untoward instructions as the applet is being loaded、In particular, the applet cannot write files to disk or erase files (one of the mainstays of viruses)、Applets are generally considered to be safe, and since this is essential for reliable client/server systems, any bugs in the Java language that allow viruses are rapidly repaired、(It’s worth noting that the browser software actually enforces these security restrictions, and some browsers allow you to select different security levels to provide varying degrees of access to your system、)You might be skeptical of this rather draconian restriction against writing files to your local disk、For example, you may want to build a local database or save data for later use offline、The initial vision seemed to be that eventually everyone would get online to do anything important, but that was soon seen to be impractical (although low-cost “Internet appliances” might someday satisfy the needs of a significant segment of users)、The solution is the “signed applet” that uses public-key encryption to verify that an applet does indeed come from where it claims it does、A signed applet can still trash your disk, but the theory is that since you can now hold the applet creator accountable they won’t do vicious things、Java provides a framework for digital signatures so that you will eventually be able to allow an applet to step outside the sandbox if necessary、Digital signatures have missed an important issue, which is the speed that people move around on the Internet、If you download a buggy program and it does something untoward, how long will it be before you discover the damage? It could be days or even weeks、By then, how will you track down the program that’s done it? And what good will it do you at that point?7、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 problem of 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 the learning 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 a body of legacy code that you’ve been using in a more traditional client/server approach, whereby you must physically install client programs 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 best plan 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、8、Server-side programmingThis whole discussion has ignored the issue of server-side programming、What happens when you make a request of a server? Most of the time the request is simply “send me this file、” Your browser then interprets the some appropriate fashion: as an HTML page, a graphic image, a Java applet, a script program, etc、A more complicated request to a server generally involves a database transaction、A common scenario involves a request for a complex database search, which the server then formats into an HTML page and sends to you as the result、(Of course, if the client has more intelligence via Java or a scripting language, the raw data can be sent and formatted at the client end, which will be faster and less load on the server、) Or you might want to register your name in a database when you join a group or place an order, which will involve changes to that database、These database requests must be processed via some code on the server side, which is generally referred to as server-side programming、Traditionally, server-side programming has been performed using Perl and CGI scripts, but more sophisticated systems have been appearing、These include Java-based Web servers that allow you to perform all your server-side programming in Java by writing what are called servlets、Servlets and their offspring, JSPs, are two of the most compelling reasons that companies who develop Web sites are moving to Java, especially because they eliminate the problems of dealing with differently abled browsers、9、separate arena: applicationsMuch of the brouhaha over Java has been over applets、Java is actually a general-purpose programming language that can solve any type of problem—at least in theory、And as pointed out previously, there might be more effective ways to solve most client/server problems、When you move out of the applet arena (and simultaneously release the restrictions, such as the one against writing to disk) you enter the world of general-purpose applications that run standalone, without a Web browser, just like any ordinary program does、Here, Java’s strength is not only in its portability, but also its programm ability、As you’ll see throughout this book, Java has many features that allow you to create robust programs in a shorter period than with previous programming languages、Be aware that this is a mixed blessing、You pay for the improvements through slower execution speed (although there is significant work going on in this area—JDK 1、3, in particular, introduces the so-called “hotspot” performance improvements)、Like any language, Java has built-in limitations that might make it inappropriate to solve certain types of programming problems、Java is a rapidly evolving language, however, and as each new release comes out it becomes more and more attractive for solving larger sets of problems、Java与因特网既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它就是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不就是很明显。

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

中文翻译基于Java技术的Web应用设计模型的比较研究来源:School of Computer Science and Engineering University of New South WalesSydney, NSW 2052, Australia作者:Budi Kurniawan and Jingling Xue摘要Servlet技术是在建立可扩展性Web应用中被应用最广泛的技术。

在运用JAVA技术开发Web应用中有四种模型,分别是:Model 1、Model 2、Struts和JavaServer Faces JSF。

Model 1使用一连串的JSP页面,Model 2采用了模型,视图,控制器MVC模式。

Struts是一个采用了Model 2设计模型的框架,JSF是一种支持ready-to-use组件来进行快速Web应用开发的新技术。

Model 1对于中等和大型的应用来说很难维护,所以不推荐使用。

本文通过利用Model 2、Struts和JSF这三种模型分别构建三个不同版本的在线商店应用程序来比较和评价这三种模型在应用程序开发和性能上的差异。

1.绪论当今Web应用是一种展现动态内容的最普遍的方式。

构建Web应用有许多种方法,其中最流行的是Servlet技术。

这种技术的流行是因为它比CGI、PHP等其他技术更具优越性。

然而Servlet对于开发来说还是麻烦的,因为它在传送HTML 标签时需要程序员将他们组合成为一个字符串对象,再将这个对象传给浏览器。

同样的,对于输出的一个很小的改动也要求Servlet被重新编译。

基于这个原因SUN 公司发明了JavaServer Pages JSP技术。

JSP允许HTML标签和Java代码混合在一起,每个页面将被转化为一个Servlet,一个JSP就是一个Servlet,而且编译将在JSP页面第一次被请求时自动进行改变输出也不需要重新编译。

另外通过使用JavaBean和定制标签库,JSP能够将表示与业务逻辑相分离。

现今基于JAVA的Web应用开发标准是将servlets与JSP结合在一起。

随后出现了许多种设计模型用来构建servlet/JSP应用。

Model 1、Model 2、Struts]和JavaServer Faces JSF。

Model 1和Model 2最早是在JSP规范中被提及的。

Model 1只使用JSP而不使用servlet,Model 2则结合了JSP与servlet。

Model 1和Model 2的使用是有条件的。

Model 1适合与开发原型和非常小的应用,Model 2则是开发中型和大型应用推荐的设计模型。

由于Model 2越来越被行业所接受,一个建立Struts框架的开源项目也因此被启动了。

Struts通过为Model 2提供了模型、视图、控制器中的控制器来完善Model 2。

另外Struts提供了更好的页面导航管理机制和一些定制标签库,能够进行更快速的开发。

尽管它学习难度大,并且实际上它没有在任何的规范中被定义,但是它还是作为Model 2的一种替代获得了流行。

JavaServer Faces是在JCP的JSR-127规范下被建立。

Sun公司力推这项技术,希望它能够成为构建Java Web应用的最终模型。

JSF最重要的特性是对ready-to-use组件的支持,比如,可扩展用户接口组件、简易的页面导航、输入验证、数据转换和JavaBean管理机制。

servlet/JSP程序员面临的问题是选择最合适的设计模型。

明显的JSF在开发时间上提供了更好的解决方案。

然而,有些人担心实施JSF的开销所带来的性能下降而不愿采用这种技术。

我们使用Model 2、 Struts和JSF分别构建三个不同版本的在线商店应用比较的参数是代码的行数、类的数目和性能测试结果。

我们研究哪种设计模型能够进行最快速的开发。

我们评估基于这些模型的应用的性能。

我们提供一些建议来完善现有的设计模型使得开发速度更快。

文章的余下部分组织如下第二部分讨论了Web开发中的问题,第三部分解释了三个设计模型如何来解决这些开发问题,第四部分详细介绍了试验所需要的硬件和软件,第五部分给出试验的结果并进行分析,第六部分回顾相关工作,第七部分得出结论并提出了一些改进现有设计模型的建议。

2. Web开发中的问题所有的Java开发都使用Servlet技术作为基础技术。

同样的所有的Java Web应用都有一些问题需要解决:1.用户接口是在客户浏览器上呈现出的HTML标签。

任何在应用中使用的服务器端组件都必须被编码成为正确的HTML标签。

除了显示内容和数据外,用户接口还负责接收用户的输入。

2.用户的输入必须要验证。

输入的验证有两种类型:服务器端和客户端。

顾名思义,服务器端的输入验证是在输入的数据到达服务器后在服务器上进行的。

客户端的输入验证是在浏览器上完成的,一般使用JavaScript或其他脚本语言。

利用客户端进行输入验证的好处是反应迅速,而且能够减轻服务器的负载。

无论是否存在客户端输入验证,服务器端的输入验证是一定要执行的。

因为无法保证用户的浏览器的脚本特性被打开,而且恶意用户能够很轻松的绕过客户端的验证。

3.在基于Java的Web应用中模型对象是以JavaBean的形式出项的。

模型对象组成了基于MVC设计模型的模型部分。

一个模型对象能够用来绑定一个组件的值以备下阶段使用。

此外它能够封装需要执行的业务逻辑。

4.大多数的Web应用都包含多个页面,能够使用户从一个页面跳转到另一个页面。

所有的基于MVC的设计模式都使用Servlet作为控制部分。

这个Servlet也作为进入应用的唯一入口。

当前的请求之后哪个页面会被显示取决于请求参数的具体值。

管理页面导航是至关重要的。

3. Web应用设计模型Model 2设计模型是基于模型、视图、控制器、MVC设计模式的。

正如Burbeck所解释的,在MVC中有三个主要模块:控制器、视图和模型。

控制器作为应用的中心,所有的用户交互都要通过它。

视图包含了应用的显示,而模型用来存储数据和封装应用的业务逻辑。

随后,Struts框架提供了一个通用框架能够容易的构建Model 2应用。

最主动的是同样使用MVC设计模式的JSF。

在之后的章节,我们将来讨论这三种设计模型,并且说明每一种设计模型是怎样来解决之前提到的开发问题。

3.1 Model 2一个基于Model 2设计模型的Java Web应用有一个作为控制部分的servlet 称为控制器servlet。

所有的请求首先被这个servlet处理,它通过RequestDispatcher对象将请求迅速的分派到合适的视图。

在Model 2中视图是通过JSP页面来表现的。

JavaBean作为Model 2 的模型部分,用来在应用中存储数据。

除了存储数据JavaBean还用来封装业务逻辑。

每个HTTP请求都带有一个行为参数,用来指出哪个视图指派给这个请求。

程序员必须在所有的JSP页面中为用户接口编写HTML标签代码,并且编写输入验证代码。

此外,模型对象被单独的JSP 页面所管理。

3.2 Struts Struts框架是Model 2设计模型的一个改进。

它提供了一个默认的控制器servlet 使得程序员不用非得去编写一个。

Struts允许在应用配置文件一个XML文件中编写导航规则来减轻页面导航的任务,改变导航规则不需要重新编译。

除了更简单的页面导航,Struts还提供了定制标签库来定义标签代表HTML元素。

这些标签中的一些用来处理异常,而且Struts支持国际化,能够显示本地化的错误消息。

就像Model 2一样,Struts使用JavaBean作为模型。

此外Struts程序员必须编写输入验证代码。

3.3 JSFJSF同样使用了一个控制器servlet称为FacesServlet。

这个Servlet是整个JSF应用的唯一入口。

JSF同样使用JSP页面作为它的视图,使用JavaBean作为模型对象。

与Model 2和Struts不同,JSF提供了能够写入JSP页面的ready-to-use的用户接口组件。

在JSF应用中的页面的调用,FacesServlet建立了一个组件树来显示JSP页面的请求。

大部分的组件还能够触发事件来构成JSF的事件驱动。

对于页面导航,JSF使用了和Struts类似的方法,即允许在一个应用控制文件,XML文件中定义导航规则。

JSF应用与非JSF的servlet/JSP应用的不同在于JSF是事件驱动的。

JSF的用户接口是一个或多个JSP页面,用来服务诸如表单和输入框等Web组件。

这些组件以JSF定制标签的形式出现而且能够保存数据。

一个组件能够嵌套在另一个组件中,有可能形成一个组件的树状结构。

在普通的servlet/JSP应用中,使用JavaBean来存储用户输入的数据。

4.运行环境以下是我们实验的软硬件详细描述。

4.1 Servlet容器Java Web应用是在servlet容器中运行的,在应用中它一个引擎用来处理接踵而来的请求资源的HTTP请求。

在这个试验项目中,我们使用Tomcat——一个来自Apache软件基金会的开源的servlet容器,版本号是6.0。

基本上一个servlet 容器通过执行下面的任务来处理一个servlet:创建一个HttpRequest对象创建一个HttpResponse对象传递HttpRequest、HttpResponse对象来调用Servlet接口的service方法4.2 测试用客户端为了进行性能测试,我们使用同样来自Apache软件基金会的JMeter1.9来模拟多用户。

JMeter允许用户选择一定数量的线程来执行测试。

每个线程模拟了一个不同的用户。

JMeter来能允许我们选择完成一次测试的测试次数。

使用JMeter 来测试一个Web应用。

你只要直接向某个IP地址、上下文路径和端口号发出请求。

你也可以将请求参数包含在HTTP请求中。

对于一个测试,JMeter将服务器的响应时间以毫秒的形式输出。

从响应时间,我们能够得到服务器执行服务的每秒命中次数。

4.3 硬件为了得到最大的性能度量精度,我们使用不同的计算机来进行应用的测试。

运行应用的是一台XP计算机,它的配置如下:Intel Core 1GHz CPU 、1G RAM。

测试用客户端是运行JMeter的Windows2000计算机,具体配置如下:Intel Core1GHz CPU、 1G RAM。

5.结论我们得到两类实验结果:开发的难易程度和性能。

开发的难易程度比较了类的数目和代码的行数。

这些数目显示了遵从某个设计模型来开发一个应用的难易程度。

一个应用包含较少的类和较少的代码行数说明应用相对而言更容易构建。

相关文档
最新文档