外文翻译---JSP技术与主流JAVA+EE开源框架(SSH)技术简介

外文翻译---JSP技术与主流JAVA+EE开源框架(SSH)技术简介
外文翻译---JSP技术与主流JAVA+EE开源框架(SSH)技术简介

中文3170字

本科毕业设计外文翻译

JSP technology and mainstream open-source framework for JAVA EE

院(系、部)名称:工商管理学院

专业名称:信息管理与信息系统

学生姓名:

学生学号:

指导教师:

2012年 5月 18日

JSP technology and mainstream open-source framework for

JA V AEE

1.JSP Profile

JSP (Java Server Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*.htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*.jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems.

JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy.

Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function.JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit.

JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced.

JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure mainly for all the characteristics of the Internet. JSP technology strength: (1) time to prepare, run everywhere. At this point Java better than PHP, in addition to systems, the code not to

make any changes.(2) the multi-platform support. Basically on all platforms of any development environment, in any environment for deployment in any environment in the expansion. Compared ASP / PHP limitations are obvious. (3) a strong scalability. From only a small Jar documents can run Servlet / JSP, to the multiple servers clustering and load balancing, to multiple Application for transaction processing, information processing, a server to numerous servers, Java shows a tremendous Vitality. (4) diver sification and powerful development tools support. This is similar to the ASP, Java already have many very good development tools, and many can be free, and many of them have been able to run on a variety of platforms under. JSP technology vulnerable:(1) and the same ASP, Java is the advantage of some of its fatal problem. It is precisely because in order to cross-platform functionality, in order to extreme stretching capacity, greatly increasing the complexity of the product. (2) Java's speed is class to complete the permanent memory, so in some cases by the use of memory compared to the number of users is indeed a "minimum cost performance." On the other hand, it also needs disk space to store a series of. Java documents and. Class, as well as the corresponding versions of documents.

2. J2EE Development Framework

Java2 Enterprise Edition middleware unified ideology played a significant role. For example, J2EE for distributed transaction management, directory services and messaging services provide a standard programming interface. J2EE-based -Java2Standard Edition (J2SE), successfully access for Java provides a standard relational database.

But, as this article "J2EE programming of the lack of support", as mentioned, J2EEplatform does not provide a satisfactory application programming model. Sun and some of the major application server vendors wanted to use the development tools to reduce the complexity of J2EE development, but these tools are no other outstanding JA V A development tools, which have advanced refactoring tools, and. NET platform compared, J2EE tool support appeared to be very inferior.

Many J2EE development tools automatically generate the code for the same complex as the tools themselves. In many small-scale J2EE open source community developers chose another way of development - some can be difficult to reduce the development of J2EE development framework, the more popular such as: Struts, Hibernate, and Spring Framework, J2EE project types in many of today they play an important the role.

2.1 Spring Framework

The Spring Framework is an open source application framework for the Java platform.

The first version was written by Rod Johnson who released the framework with the publication of his book Expert One-on-One J2EE Design and Development in October 2002. The framework was first released under the Apache 2.0 license in June 2003. The first milestone release, 1.0, was released in March 2004, with further milestone releases in September 2004 and March 2005. The Spring 1.2.6 framework won a Jolt productivity award and a JAX Innovation Award in 2006. Spring 2.0 was released in October 2006, and Spring 2.5 in November 2007. In December 2009 version 3.0 GA was released. The current version is 3.0.5.

The core features of the Spring Framework can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the Spring Framework does not impose any specific programming model, it has become popular in the Java community as an alternative to, replacement for, or even addition to the Enterprise JavaBean (EJB) model.

Modules The Spring Framework comprises several modules that provide a range of services:

Inversion of Control container: configuration of application components and lifecycle management of Java objects

Aspect-oriented programming: enables implementation of cross-cutting routines Data access: working with relational database management systems on the Java platform using JDBC and object-relational mapping tools

Transaction management: unifies several transaction management APIs and coordinates transactions for Java objects

Model-view-controller: an HTTP and Servlet-based framework providing hooks for extension and customization

Remote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP)

Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring model.

Batch processing: a framework for high-volume processing featuring reusable

functions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management

Authentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi Security System for Spring).

Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMX

Messaging: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS APIs

Testing: support classes for writing unit tests and integration tests

Inversion of Control container Central to the Spring Framework is its Inversion of Control container, which provides a consistent means of configuring and managing Java objects using callbacks. The container is responsible for managing object lifecycles: creating objects, calling initialization methods, and configuring objects by wiring them together.

Objects created by the container are also called Managed Objects or Beans. Typically, the container is configured by loading XML files containing Bean definitions which provide the information required to create the beans.

Objects can be obtained by means of Dependency lookup or Dependency injection. Dependency lookup is a pattern where a caller asks the container object for an object with a specific name or of a specific type. Dependency injection is a pattern where the container passes objects by name to other objects, via either constructors, properties, or factory methods.

In many cases it's not necessary to use the container when using other parts of the Spring Framework, although using it will likely make an application easier to configure and customize. The Spring container provides a consistent mechanism to configure applications and integrates with almost all Java environments, from small-scale applications to large enterprise applications.

The container can be turned into a partially-compliant EJB3 container by means of the Pitchfork project. The Spring Framework is criticized by some as not being standards compliant. However, Spring Source doesn't see EJB3 compliance as a major goal, and claims that the Spring Framework and the container allow for more powerful programming models.

Aspect-oriented programming framework The Spring Framework has its own AOP framework which modularizes cross-cutting concerns in aspects. The motivation for creating a separate AOP framework comes from the belief that it would be possible to provide basic AOP features without too much complexity in either design, implementation, or configuration. The SAOP framework also takes full advantage of the Spring Container.

The Spring AOP framework is interception based, and is configured at runtime. This removes the need for a compilation step or load-time weaving. On the other hand, interception only allows for public or protected method execution on existing objects at a join point.

Compared to the AspectJ framework, Spring AOP is less powerful but also less complicated. Spring 1.2 includes support to configure AspectJ aspects in the container. Spring 2.0 added more integration with AspectJ; for example, the pointcut language is reused and can be mixed with SpAOP-based aspects. Further, Spring 2.0 added a Spring Aspects library which uses AspectJ to offer common Spring features such as declarative transaction management and dependency injection via AspectJ compile-time or load-time weaving. Spring Source also uses AspectJ for AOP in other Spring projects such as Spring Roo and Spring Insight, with Spring Security also offering an AspectJ-based aspect library.

Spring AOP has been designed to make it able to work with cross-cutting concerns inside the Spring Framework. Any object which is created and configured by the container can be enriched using Spring AOP.

The Spring Framework uses Spring AOP internally for transaction management, security, remote access, and JMX.

Since version 2.0 of the framework, Spring provides two approaches to the AOP configuration:schema-based approach.@AspectJ-based annotation style.

The Spring team decided not to introduce new AOP-related terminology; therefore, in the Spring reference documentation and API, terms such as aspect, join point, advice, pointcut, introduction, target object (advised object), AOP proxy, and weaving all have the same meanings as in most other AOP frameworks (particularly AspectJ).

Data access framework Spring's data access framework addresses common difficulties developers face when working with databases in applications. Support is provided for all popular data access frameworks in Java: JDBC, iBatis, Hibernate,

JDO, JPA, Oracle Top Link, Apache OJB, and Apache Cayenne, among others.

For all of these supported frameworks, Spring provides these features:

Resource management - automatically acquiring and releasing database resources

Exception handling - translating data access related exception to a Spring data access hierarchy

Transaction participation - transparent participation in ongoing transactions

Resource unwrapping - retrieving database objects from connection pool wrappers

Abstraction for BLOB and CLOB handling

All these features become available when using Template classes provided by Spring for each supported framework. Critics say these Template classes are intrusive and offer no advantage over using (for example) the Hibernate API.. directly. In response, the Spring developers have made it possible to use the Hibernate and JPA APIs directly. This however requires transparent transaction management, as application code no longer assumes the responsibility to obtain and close database resources, and does not support exception translation.

Together with Spring's transaction management, its data access framework offers a flexible abstraction for working with data access frameworks. The Spring Framework doesn't offer a common data access API; instead, the full power of the supported APIs is kept intact. The Spring Framework is the only framework available in Java which offers managed data access environments outside of an application server or container. While using Spring for transaction management with Hibernate, the following beans may have to be configured.

Transaction management framework Spring's transaction management framework brings an abstraction mechanism to the Java platform. Its abstraction is capable of working with local and global transactions (local transaction does not require an application server).working with nested transactions working with transaction safe points working in almost all environments of the Java platform In comparison, JTA only supports nested transactions and global transactions, and requires an application server (and in some cases also deployment of applications in an application server).

The Spring Framework ships a Platform Transaction Manager for a number of transaction management strategies:

Transactions managed on a JDBC Connection

Transactions managed on Object-relational mapping Units of Work

Transactions managed via the JTA Transaction Manager and User Transaction Transactions managed on other resources, like object databases

Next to this abstraction mechanism the framework also provides two ways of adding transaction management to applications:

Programmatically, by using Spring's Transaction Template

Configuratively, by using metadata like XML or Java 5 annotations

Together with Spring's data access framework — which integrates the transaction management framework —it is possible to set up a transactional system through configuration without having to rely on JTA or EJB. The transactional framework also integrates with messaging and caching engines.

The BoneCP Spring/Hibernate page contains a full example project of Spring used in conjunction with Hibernate.

Model-view-controller framework The Spring Framework features its own MVC framework, which wasn't originally planned. The Spring developers decided to write their own web framework as a reaction to what they perceived as the poor design of the popular Jakarta Struts web framework, as well as deficiencies in other available frameworks. In particular, they felt there was insufficient separation between the presentation and request handling layers, and between the request handling layer and the model.

Like Struts, Spring MVC is a request-based framework. The framework defines strategy interfaces for all of the responsibilities which must be handled by a modern request-based framework. The goal of each interface is to be simple and clear so that it's easy for Spring MVC users to write their own implementations if they so choose. MVC paves the way for cleaner front end code. All interfaces are tightly coupled to the Servlet API. This tight coupling to the Servlet API is seen by some as a failure on the part of the Spring developers to offer a high-level abstraction for web-based applications [citation needed]. However, this coupling makes sure that the features of the Servlet API remain available to developers while offering a high abstraction framework to ease working with said API.

The Dispatcher Servlet class is the front controller of the framework and is responsible for delegating control to the various interfaces during the execution phases of a HTTP request.

The most important interfaces defined by Spring MVC, and their responsibilities, are listed below:

Handler Mapping: selecting objects which handle incoming requests (handlers) based on any attribute or condition internal or external to those requests Handler Adapter: execution of objects which handle incoming requests

Controller: comes between Model and View to manage incoming requests and redirect to proper response. It essentially is like a gate that directs the incoming information. It switches between going into model or view.

View: responsible for returning a response to the client. It is possible to go straight to view without going to the model part. It is also possible to go through all three.

View Resolver: selecting a View based on a logical name for the view (use is not strictly required)

Handler Interceptor: interception of incoming requests comparable but not equal to Servlet filters (use is optional and not controlled by Dispatcher Servlet).

Locale Resolver: resolving and optionally saving of the locale of an individual user

Multipart Resolver: facilitate working with file uploads by wrapping incoming requests

Each strategy interface above has an important responsibility in the overall framework. The abstractions offered by these interfaces are powerful, so to allow for a set of variations in their implementations, Spring MVC ships with implementations of all these interfaces and together offers a feature set on top of the Servlet API. However, developers and vendors are free to write other implementations. Spring MVC uses the Java java.util.Map interface as a data-oriented abstraction for the Model where keys are expected to be string values.

The ease of testing the implementations of these interfaces seems one important advantage of the high level of abstraction offered by Spring MVC. Dispatcher Servlet is tightly coupled to the Spring Inversion of Control container for configuring the web layers of applications. However, applications can use other parts of the Spring Framework—including the container—and choose not to use Spring MVC.

Because Spring MVC uses the Spring container for configuration and assembly, web-based applications can take full advantage of the Inversion of Control features offered by the container. This framework allows for multi layering. It allows for the

code to be broken apart and used more effectively in segments, while allowing the mvc to do the work. It allows for back and forth transmission of data. Some designs are more linear without allowing a forward and backward flow of information. MVC is designed very nicely to allow this interaction. It is used more than just in web design, but also in computer programming. It's very effective for web design. Basically allows a checks and balance system to occur where before being viewed it can be properly examined.

Remote access framework Spring's Remote Access framework is an abstraction for working with various RPC-based technologies available on the Java platform both for client connectivity and exporting objects on servers. The most important feature offered by this framework is to ease configuration and usage of these technologies as much as possible by combining Inversion of Control and AOP.

The framework also provides fault-recovery (automatic reconnection after connection failure) and some optimizations for client-side use of EJB remote stateless session beans.

Convention-Over-Configuration Rapid Application Development Spring Roo is Spring's Convention-over-configuration solution for rapidly building applications in Java. It currently supports Spring Framework, Spring Security and Spring Web Flow, with remaining Spring projects scheduled to be added in due course. Roo differs from other rapid application development frameworks by focusing on:

The following diagram represents the Spring Framework Architecture

2.2 Struts Introduction

Apache Struts From Wikipedia, the free encyclopedia Jump to: navigation, search

"Struts" redirects here. For the structural component, see strut. For other meanings, see strut (disambiguation).

This article includes a list of references, but its sources remain unclear because it has insufficient inline citations.

Please help to improve this article by introducing more precise citations where appropriate.

Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture. It was originally

created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top level Apache project in 2005.

Design goals and over view in a standard Java EE web application, the client will typically submit information to the server via a web form. The information is then either handed over to a Java Servlet that processes it, interacts with a database and produces an HTML-formatted response, or it is given to a Java Server Pages (JSP) document that inter mingles HTML and Java code to achieve the same result. Both approaches are often considered inadequate for large projects because they mix application logic with presentation and make maintenance difficult.

The goal of Struts is to separate the model (application logic that interacts with a database) from the view (HTML pages presented to the client) and the controller (instance that passes information between view and model). Struts provides the controller (a servlet known as ActionServlet) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT and Velocity are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml that binds together model, view and controller.

Requests from the client are sent to the controller in the form of "Actions" defined in the configuration file; if the controller receives such a request it calls the corresponding Action class that interacts with the application-specific model code. The model code returns an "ActionForward", a string telling the controller what output page to send to the client. Information is passed between model and view in the form of special JavaBeans. A powerful custom tag library allows it to read and write the content of these beans from the presentation layer without the need for any embedded Java code.

Struts is categorized as a request-based web application framework Struts also supports internationalization by web forms, and includes a template mechanism called "Tiles" that (for instance) allows the presentation layer to be composed from independent header, footer, and content components History The Apache Struts Project was launched in May 2000 by Craig R. McClanahan to provide a standard MVC framework to the Java community. In July 2001, version 1.0 was released.

Struts2 was originally known as WebWork 2. After having been developed separately for several years, WebWork and Struts were combined in 2008 to create

Struts 2.

Competing MVC frameworks Although Struts is a well-documented, mature, and popular framework for building front ends to Java applications, there are other frameworks categorized as "lightweight" MVC frameworks such as Spring MVC, Stripes, Wicket, Play!, and Tapestry. The new XForms standards and frameworks may also be another option to building complex web Form validations with Struts in the future.

The WebWork framework spun off from Apache Struts aiming to offer enhancements and refinements while retaining the same general architecture of the original Struts framework. However, it was announced in December 2005 that Struts would re-merge with WebWork. WebWork 2.2 has been adopted as Apache Struts2, which reached its first full release in February 2007.

In 2004 Sun launched an addition to the Java platform, called Java Server Faces (JSF). Aside from the original Struts framework, the Apache project previously offered a JSF-based framework called Shale, which was retired in May 2009.

In this section we will discuss about Architecture. Struts is famous for its robust Architecture and it is being used for developing small and big software projects.

Struts is an open source framework used for developing J2EE web applications using Model View Controller (MVC) design pattern. It uses and extends the Java Servlet API to encourage developers to adopt an MVC architecture. Struts framework provides three key components:

A request handler provided by the application developer that is used to mapped to a particular URI. A response handler which is used to transfer the control to another resource which will be responsible for completing the response.

A tag library which helps developers to create the interactive form based applications with server pages Learn Struts 2.2.1 framework Struts provides you the basic infrastructure infra structure for implementing MVC allowing the developers to concentrate on the business logic The main aim of the MVC architecture is to separate the business logic and application data from the presentation data to the user.

Here are the reasons why we should use the MVC design pattern They are resuable: When the problems recurs, there is no need to invent a new solution, we just have to follow the pattern and adapt it as necessary. They are expressive: By using the MVC design pattern our application becomes more expressive.

1). Model: The model object knows about all the data that need to be displayed.

It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.

2). View: The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the view's to maintain the consistency in its presentation when the model changes.

3). Controller: Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In GUIs, the views and the controllers often work very closely together.

The Struts framework is composed of approximately 300 classes and interfaces which are organized in about 12 top level packages. Along with the utility and helper classes framework also provides the classes and interfaces for working with controller and presentation by the help of the custom tag libraries. It is entirely on to us which model we want to choose. The view of the Struts architecture is given below: The Struts Controller Components Whenever a user request for something, then the request is handled by the Struts Action Servlet. When the ActionServlet receives the request, it intercepts the URL and based on the Struts Configuration files, it gives the handling of the request to the Action class. Action class is a part of the controller and is responsible for communicating with the model layer.

The Struts View Components: The view components are responsible for presenting information to the users and accepting the input from them. They are responsible for displaying the information provided by the model components. Mostly we use the Java Server Pages (JSP) for the view presentation. To extend the capability of the view we can use the Custom tags, java script etc.

The Struts model component The model components provides a model of the business logic behind a Struts program. It provides interfaces to databases or back- ends systems. Model components are generally a java class. There is not any such defined format for a Model component, so it is possible for us to reuse Java code

which are written for other projects. We should choose the model according to our client requirement.

2.3 Hibernate FrameWork

Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database. Hibernate solves object-relational impedance mismatch problems by replacing direct persistence-related database accesses with high-level object handling functions.

Hibernate is free software that is distributed under the GNU Lesser General Public License Hibernate's primary feature is mapping from Java classes to database tables (and from Java data types to SQL data types). Hibernate also provides data query and retrieval facilities. Hibernate generates the SQL calls and attempts to relieve the developer from manual result set handling and object conversion and keep the application portable to all supported SQL databases with little performance overhead.

Mapping Java classes to database tables is accomplished through the configuration of an XML file or by using Java Annotations. When using an XML file, Hibernate can generate skeletal source code for the persistence classes. This is unnecessary when annotation is used. Hibernate can use the XML file or the annotation to maintain the database schema.

Facilities to arrange one-to-many and many-to-many relationships between classes are provided. In addition to managing association between objects, Hibernate can also manage reflexive associations where an object has a one-to-many relationship with other instances of its own type.

Hibernate supports the mapping of custom value types. This makes the following scenarios possible:

Overriding the default SQL type that Hibernate chooses when mapping a column to a property.

Mapping Java Enum to columns as if they were regular properties.

Mapping a single property to multiple columns.

Persistence Hibernate provides transparent persistence for Plain Old Java Objects (POJOs). The only strict requirement for a persistent class is a no-argument constructor, not necessarily public. Proper behavior in some applications also requires

special attention to the equals() and hashCode() methods.

Collections of data objects are typically stored in Java collection objects such as Set and List. Java generics, introduced in Java 5, are supported. Hibernate can be configured to lazy load associated collections. Lazy loading is the default as of Hibernate 3.Related objects can be configured to cascade operations from one to the other. For example, a parent such as an Album object can be configured to cascade its save and/or delete operation to its child Track objects. This can reduce development time and ensure referential integrity. A dirty checking feature avoids unnecessary database write actions by performing SQL updates only on the modified fields of persistent objects Hibernate Query Language (HQL)Hibernate provides an SQL inspired language called Hibernate Query Language (HQL) which allows SQL-like queries to be written against Hibernate's data objects. Criteria Queries are provided as an object-oriented alternative to HQL. Integration Hibernate can be used both in standalone Java applications and in Java EE applications using servlets or EJB session beans. It can also be included as a feature in other programming languages. For example, Adobe integrated Hibernate into version 9 of ColdFusion (which runs on J2EE app servers) with an abstraction layer of new functions and syntax added into CFML Entities and componentsIn Hibernate jargon, an entity is a stand-alone object in Hibernate's persistent mechanism which can be manipulated independently of other objects. In contrast, a component is subordinate to other entities and can be manipulated only with respect to other entities. For example, an Album object may represent an entity but the Tracks object associated with the Album objects would represent a component of the Album entity if it is assumed that Tracks can only be saved or retrieved from the database through the Album object. Unlike J2EE, it can switch databases History Hibernate was started in 2001 by Gavin King as an alternative to using EJB2-style entity beans. Its mission back then was to simply offer better persistence capabilities than offered by EJB2 by simplifying the complexities and allowing for missing features Early in 2003, the Hibernate development team began Hibernate2 releases which offered many significant improvements over the first release JBoss, Inc. (now part of Red Hat) later hired the lead Hibernate developers and worked with them in supporting Hibernate.

As of 2010 update the current version of Hibernate is Version 3.x. This version introduced new features like a new Interceptor/Callback architecture, user defined filters, and JDK 5.0 Annotations (Java's metadata feature). As of 2010[update]

Hibernate 3 (version 3.5.0 and up) is a certified implementation of the Java Persistence API 2.0 specification via a wrapper for the Core module which provides conformity with the JSR 317 standard Application programming interface A session is intended to last as long as the logical transaction on the database. Due to the latter feature Session implementations are not expected to be thread safe nor to be used by multiple clients.

JSP技术与主流JAVA EE开源框架(SSH)技术简介

1 JSP技术简介

JSP(Java Server Pages)是由Sun公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件。用JSP开发的Web应用是跨平台的,即能在Linux运行,也能在其他操作系统上运行。

JSP技术使用Java编程语言编写类XML的tags和Scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和Scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。

Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。JSP的1.0规范的最后版本是1999年9月推出的,12月又推出了1.1规范。日前较新的是JSP 1.2规范,JSP2.0规范的征求意见稿也已出台。JSP页而由HTML代码和嵌入其中的java代码所组成。服务器在页而被客户端请求以后对这些java代码进行处理,然后将生成的HTML页而返回给客户端的浏览器。Java Servlet是JSP的技术基础,而且大型的Web应用程序的开发需要Java和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的而向对象,其有平台无关性且安全可靠,主要而向因特网的所有特点。

2 J2EE开发框架

Java2企业版为中间件领域思想的统一上发挥了很大的作用。比如,J2EE为分布式事务管理、目录服务和消息服务提供了一套标准的编程接口。J2EE的基础——Java2标准版(J2SE) ,成功地为Java提供了一套访问关系数据库的标准。

但是,就像本文中“J2EE缺乏对编程的支持”提到的一样,J2EE这个平台没有能够提供一个令人满意的应用程序编程模型。Sun公司和一些大的应用服务器供应商都想用开发工具来降低J2EE开发的复杂性,但是这些工具没有其他的JA V A 开发工具优秀,后者有先进的重构工具,和.NET平台相比,J2EE的工具支持显得很逊色。

很多J2EE开发工具自动产生的代码像这些工具本身同样复杂。在开源社区很多小型J2EE开发者选择了另外一种开发方式——一些可以降低J2EE开发难度的开发框架,较为流行的比如:Struts, Hibernate, 和Spring Framework,他们当

今很多J2EE项目种扮演着重要角色。

2.1 Spring框架

Spring Framework是一个开源的Java/java EE全功能栈(full-stack)的应用程序框架,以Apache许可证形式发布,也有.NET平台上的移植版本。该框架基于Expert One-on-One Java EE Design and Development(ISBN 0-7645-4385-7)一书中的代码,最初由Rod Johnson等开发。Spring Framework提供了一个简易的开发方式,这种开发方式,将避免

那些可能致使底层代码变得繁杂混乱的大量的属性文件和帮助类。Spring中包含的关键特性:强大的基于JavaBeans的采用控制翻转原则的配置管理,使得应用程序的组建更加快捷简易。一个可用于从applet到JavaEE等不同运行环境的核心Bean工厂。数据库事务的一般化抽象层,允许声明式事务管理器,简化事务的划分使之与底层无关。内建的针对JTA和单个JDBC数据源的一般化策略,使Spring的事务支持不要求JavaEE环境,这与一般的JTA或者EJB CMT相反。

JDBC抽象层提供了有针对性的异常等级(不再从SQL异常中提取原始代码),简化了错误处理,大大减少了程序员的编码量。再次利用JDBC时,你无需再写出另一个终止(finally)模块。并且面向JDBC的异常与Spring通用数据访问对象(Data Access Object)异常等级相一致。

以资源容器,DAO实现和事务策略等形式与Hibernate,JDO 和iBATIS SQL Maps集成。利用众多的翻转控制方便特性来全而支持,解决了许多典型的Hibernate集成问题。所有这些全部遵从Spring通用事务处理和通用数据访问对象异常等级规范。

灵活的基于核心Spring功能的MVC网页应用程序框架。开发者通过策略接口将拥有对该框架的高度控制,因而该框架将适应于多种呈现(VIEW)技术,例如Jsp FreeMarker,Velocity,Tiles,iText以及POI。值得注意的是,Spring中间层可以轻易地结合于任何基于MVC框架的网页层,例如Struts,WebWork,或Tapestry,提供诸如事务管理等服务的而向方而编程框架。

在设计应用程序简洁明了的框架结构Model时,MVC模式(例如struts)通常难于给出一个简洁明了的框架结构。Spring却具有能够让这部分上作变得简单的能力。程序开发员们可以使用Spring的JDBC抽象层重新设计那些复杂的框架结构。

2.2Struts技术介绍

Struts项目是Apache软件基金会(ASF)赞助的一个开源项日。它最初是

Jakarta项目中的一个子项目,并在2004年3月成为ASF的顶级项目。它通过采用Java Servlet/JSP技术,实现了基于Java EE Web应用的Model-View-Controller 〔MVC〕设计模式的应用框架(web Framework),是MVC经典设计模式中的一个经典产品。

MVC结构在Struts中,已经由一个名为ActionServlet的Servlet充当控制器(Controller)的角色,根据描述模型、视图、控制器对应关系的struts-config.xml 的配置文件,转发视图(view)的请求,组装响应数据模型(Model)。在MVC的模型(Model)部分,经常划分为两个主要子系统(系统的内部数据状态与改变数据状态的逻辑动作),这两个概念子系统分别具体对应struts里的ActionForm与Action 两个需要继承实现超类。在这里,Struts可以与各种标准的数据访问技术结合在一起,包括Enterprise Java Bean(EJB),JDBC与JNDL。在struts的视图(view)端,除了使用标准的Java Server Pages(JSP)以外,还提供了大量的标签库使用,同时也可以与其他表现层组件技术(产品)进行整合,比如XSLT等。通过应用struts的框架,最终用户可以把大部分的关注点放在自己的业务逻辑(Action)与映射关系的配置文件(struts-config.xml)中。

发展历程在JavaEE的Web应用发展的初期,除了使用Servlet技术以外,普遍是在JSP的源代码中,采用HTML与java代码混合的方式进行开发。因为这两种方式不可避免的要把表现与业务逻辑代码混合在一起,都给前期开发与后期维护带来巨大的复杂度。为了摆脱上述的约束与局限,把业务逻辑代码从表现层中清晰的分离出来,2000年,CraigMcClanahan采用了MVC的设计模式开发Struts。后来该框架产品一度被认为是最广泛、最流行Java的WEB应用框架。

2006年,Webwork与Struts这两个优秀的Java EEweb框架(Web FrameWork)的团体,决定合作共同开发一个新的,整合了WebWork与Struts优点,并且更加优雅、扩展性更强的框架,命名为“Struts2 ",原Struts的1.x版本产品称为“Struts1”至此,Struts项目并行提供与维护两个主要版本的框架产品一一Struts1与Struts2。很多开发人员认为Shuts目前尚不成熟,应用的成本较高。附带的一点点建议:Struts的优点主要集中体现在两个方而:Taglib和页而异航。Taglib是Struts的标记库,灵活动用,能大大提高开发效率。Struts这个名字来源于建筑和旧式飞机中使用的支持金属架。它的目的是为了减少在运用MVC设计模型来开发java应用的时间。你仍然需要学习和应用该架构,不过将可以完成其中一些繁重的工作。Struts跟Tomcat、Turbine等诸多Apache项目一样,是开源软件,这是它的一大优点,使开发者能更深入的了解其内部实现机制。

2.3Hibernate开源框架介绍

Hibernate是一种Java语言下的对象关系映射解决方案。它是使用GNU宽通用公共许可证发行的自由、开源的软件。它为面向对象的领域模型到传统的关系型数据库的映射,提供了一个使用方便的框架。概览它的设计目标是将软件开发人员从大量相同的数据持久层相关编程上作中解放出来。无论是从设计草案还是从一个遗留数据库开始,开发人员都可以采用Hibernate。

Hibernate不仅负责从java类到数据库表的映射(还包括从java数据类型到SQL数据类型的映射),还提供了面向对象的数据查询检索机制,从而极大地缩短的手动处理SQL和JDBC上的开发时间。

.NET上的hibernate

hibernate有个在.NET上的实现版本,称为NHibernate,在https://www.360docs.net/doc/dd4399783.html, Entity Framework发表之前,NHibernate是在.NET Framework上经常被使用的ORM实现。

hibernate的架构有三个主要部分组成:

(1). 连接管理:hibernate的连接管理服务提供的数据库连接的有效管理。数据库连接是与数据库进行交互,因为需要大量资源的开放和关闭数据库连接的最昂贵的部分。

(2). 交易管理:事务管理服务提供给用户能够同时执行多个数据库报表。

(3). 对象关系映射:对象关系映射从对象映射模型的数据表示为关系数据模型的技术。这部分是用来休眠选择,插入,更新和删除记录窗体的基础表。当我们传递一个对象到Session.save()的方法时,Hibernate读取该对象的变量的状态,并执行必要的查询。hibernate是很好的工具尽可能对象关系映射的关注,但在连接管理和事务管理方而,它在性能和能力缺乏。所以通常冬眠与其他正在使用的连接管理和事务管理上具。Hibernate提供了使用中的灵活性。它被称为“轻型”的体系结构时,我们只使用对象关系映射的组成部分。而在“全而解决”的体系结构的所有三个组件对象关系映射,连接管理和事务管理)的使用。

原文出处

《Dynamic Web Development Technologies based on JSP》

《IEEE国际计算机和信息技术会议纪要(CIT 2010)》

JSP技术简介及特点——外文翻译

JSP Technology Conspectus And Specialties By:Kathy Sierra and Bert Bates Source: Servlet&JSP The JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develop dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programming languages, in a short span of a few years, has formed a complete set of standards, and widely used in electronic commerce, etc. In China, the JSP now also got more extensive attention, get a good development, more and more dynamic website to JSP technology. The related technologies of JSP are briefly introduced. The JSP a simple technology can quickly and with the method of generating Web pages. Use the JSP technology Web page can be easily display dynamic content. The JSP technology are designed to make the construction based on Web applications easier and efficient, and these applications and various Web server, application server, the browser and development tools work together. The JSP technology isn't the only dynamic web technology, also not the first one, in the JSP technology existed before the emergence of several excellent dynamic web technology, such as CGI, ASP, etc. With the introduction of these technologies under dynamic web technology, the development and the JSP. Technical JSP the development background and development history In web brief history, from a world wide web that most of the network information static on stock transactions evolution to acquisition of an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions. Based on the browser client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extremely simplified application deployment and management (to update an application, management personnel only need to change the program on a server, not thousands of installation in client applications). So, the software industry is rapidly to build on the client browser multi-layer application. The rapid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challenge is to create the interaction based on Web applications, in these procedures, the

JSP技术简介(外文翻译)

JSP技术概述 一、JSP的好处 二、JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执 行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: 三、λJSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML: 没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 四、λ能够使用标准的网站开发工具。即使对那些对JSP一无所知的 HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 五、λ可以对开发团队进行划分。Java程序员可以致力于动态代码。Web 开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 六、在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎 所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。 二、JSP相对于竞争技术的优势 许多年前,Marty受到邀请,参加一个有关软件技术的小型(20个人)研讨会.做在Marty旁边的人是James Gosling--- Java编程语言的发明者。 隔几个位置,是来自华盛顿一家大型软件公司的高级经理。在讨论过程中,研讨会的主席提出了Jini的议题,这在当时是一项新的Java技术.主席向该经理询问他的想法.他继续说,他们会持续关注这项技术,如果这

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

毕业设计(论文) 外文文献翻译 专业 学生姓名 班级 学号 指导教师 XX 学院

外文资料名称:An Overview of Servlet and JSP Technology 外文资料出处:Internet 附件: 1.外文资料翻译译文 2.外文原文 指导教师评语: 签名: 年月日

Servlet和JSP技术简述 Nagle and Wiegley XX译 摘要:Servlet程序在服务器端运行,动态地生成Web页面与传统的CGI和许多其他类似CGI的技术相比,Java Servlet具有更高的效率,更容易使用,功能更强大,具有更好的可移植性,更节省投资。 关键字:JSP技术,Servlet,HTTP服务 1.1Servlet的功能 Servlets是运行在Web或应用服务器上的Java程序,它是一个中间层,负责连接来自Web浏览器或其他HTTP客户程序的请求和HTTP服务器上的数据库或应用程序。Servlet的工作是执行西门的任务,如图1.1所示。 图1.1Web中间件的作用 (1)读取客户发送的显式数据。 最终用户一般在页面的HTML表单中输入这些数据。然而,数据还有可能来自applet或定制的HTTP客户程序。 (2)读取由浏览器发送的隐式请求数据。 图1.1中显示了一条从客户端到Web服务器的单箭头,但实际上从客户端传送到Web服务器的数据有两种,它们分别为用户在表单中输入的显式数据,以及后台的HTTP信息。两种数据都很重要。HTTP信息包括cookie、浏览器所能识别的媒体类型和压缩模式等。 (3)生成结果。 这个过程可能需要访问数据库、执行RMI或EJB调用、调用Web服务,或者直接计算得出对应的响应。实际的数据可能存储在关系型数据库中。该数据库可能不理解HTTP,或者不能返回HTML形式的结果,所有Web浏览器不能直接与数据库进行会话。即使它能够做到这一点,为了安全上的考虑,我们也不希望让它这么做。对应大多数

jsp介绍外文翻译

外文原文 JSP JSP (JavaServer Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*. htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*. jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems. JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy. Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function. JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit. JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced. JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure, mainly for all the characteristics of the Internet. JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web

毕业设计JSP MVC外文翻译

Struts——一种开源MVC的实现 这篇文章介绍Struts,一个使用servlet和JavaServer Pages技术的一种Model-View-Controller的实现。Struts可以帮助你控制Web项目中的变化并提高专业化。即使你可能永远不会用Struts实现一个系统,你可以获得一些想法用于你未来的servlet和JSP网页的实现中。 简介 在小学校园里的小孩子们都可以在因特网上发布HTML网页。然而,有一个重大的不同在一个小学生和一个专业人士开发的网站之间。网页设计师(或者HTML开发人员)必须理解颜色、用户、生产流程、网页布局、浏览器兼容性、图像创建、JavaScript等等。设计漂亮的网站需要做大量的工作,大多数Java开发人员更注重创建优美的对象接口,而不是用户界面。JavaServer Pages(JSP)技术为网页设计人员和Java开发人员提供了一种联系钮带。 如果你开发过大型Web应用程序,你就理解“变化”这个词语。“模型-视图-控制器”(MVC)就是用来帮助你控制变化的一种设计模式。MVC减弱了业务逻辑接口和数据接口之间的耦合。Struts是一种MVC实现,它将Servlet2.2和JSP 1.1标记(属于J2EE规范)用作实现的一部分。你可能永远不会用Struts实现一个系统,但了解一下Struts或许使你能将其中的一些思想用于你以后的Servlet和JSP实现中。 模型-视图-控制器(MVC) JSP标签只解决了我们问题中的一部分。我们依然有验证、流控制、以及更新应用程序结构的问题。这就是MVC从哪儿来以及来干嘛的。MVC通过把问题分成三类来帮助解决一些与单模块相关的问题: ?Model(模型) 模块包括应用程序功能的核心。模型封装着应用程序的各个结构。有时它所包含的唯一功能就是结构。它对于视图或者控制器一无所知。 ?View(视图) 视图提供了模型的演示。它是应用程序的外表。视图可以进入模型获得者,

JSP应用框架外文翻译

中文4816字 外文资料翻译 (2011 届大学本科)题目: 学院: 专业: 班级: 姓名: 学号: 主指导教师: 2011年02 月24 日 教务处印制

外文原文 JSP application frameworks brian wright、michael freedman https://www.360docs.net/doc/dd4399783.html,/pdf/introduction-to-machine-learning/ What are application frameworks: A framework is a reusable, semi-complete application that can be specialized to produce custom applications [Johnson]. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products. A framework provides developers with a set of backbone components that have the following characteristics: 1.They are known to work well in other applications. 2. They are ready to use with the next project. 3. They can also be used by other teams in the organization. Frameworks are the classic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before you can roll your own? If you buy it, you will have to climb the learning curve—and how long is that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projects. Other types of frameworks: The idea of a framework applies not only to applications but to application componentsas well. Throughout this article, we introduce other types of frameworks that you can use with Struts. These include the Lucene search engine, the Scaffold toolkit, the Struts validator, and the Tiles tag library. Like application frameworks, these tools provide semi-complete versions of a subsystem that can be specialized to

外文文献 JSP 毕业设计

THE TECHNIQUE DEVELOPMENT HISTORY OF JSP By:Kathy Sierra and Bert Bates Source:Servlet&JSP The Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can carry out the JSP on own system. The After Sun release the JSP( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product. This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP. 1.1 GENERALIZE The JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it. JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.

JSP技术中英文对照外文翻译文献

(文档含英文原文和中文翻译) 中英文对照外文翻译 JSP技术 Java Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的

服务器端Java脚本语言—— server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。与SSJS和ASP相比,JSP具有更好的可扩展性,并且它不专属于任何一家厂商或某一特定的Web服务器。尽管JSP规范是由Sun公司制定的,但任何厂商都可以在自己的系统上实现JSP。 在Sun正式发布JSP(Java Server Pages)之后,这种新的Web应用开发技术很快引起了人们的关注。JSP为创建高度动态的Web应用提供了一个独特的开发环境。按照Sun的说法,JSP能够适应市场上包括Apache WebServer、IIS4.0在内的85%的服务器产品。 本文将介绍JSP相关的知识,以及JavaBean的相关内容,当然都是比较粗略的介绍其中的基本内容,仅仅起到抛砖引玉的作用,如果读者需要更详细的信息,请参考相应的JSP的书籍。 1.1 概述 JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准,其在动态网页的建设中有其强大而特别的功能。JSP与Microsoft的ASP技术非常相似。两者都提供在HTML代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。下面我们简单的对它进行介绍。 JSP页面最终会转换成servlet。因而,从根本上,JSP页面能够执行的任何任务都可以用servlet来完成。然而,这种底层的等同性并不意味着servlet和JSP 页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servlet相比,JSP提供下述好处: JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 能够使用标准的网站开发工具。即使是那些对JSP一无所知的HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 可以对开发团队进行划分。Java程序员可以致力于动态代码。Web开发人员可以将精力集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容

JSP技术外文翻译

翻译资料原文 Overview of JSP Technology Benefits of JSP JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose. JSP provides the following benefits over servlets alone: ? It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax. ? You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags. ? You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content. Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit. Advantages of JSP Over Competing Technologies 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

JSP外文翻译

JSP简介 JSP(JavaServer Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。 用JSP开发的Web应用是跨平台的,即能在Linux下运行,也能在其他操作系统上运行。 JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。 Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。 JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。 JSP的1.0规范的最后版本是1999年9月推出的,12月又推出了1.1规范。目前较新的是JSP1.2规范,JSP2.0规范的征求意见稿也已出台。 JSP页面由HTML代码和嵌入其中的Java代码所组成。服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。 JSP技术的强势 (1)一次编写,到处运行。在这一点上Java比PHP更出色,除了系统之外,代码不用做任何更改。 (2)系统的多平台支持。基本上可以在所有平台上的任意环境中开发,在任意环境中进行系统部署,在任意环境中扩展。相比ASP/PHP的局限性是显而易见的。

JSP外文翻译

附件1:外文资料翻译译文 Struts——一种开源MVC的实现 这篇文章介绍Struts,一个使用servlet 和JavaServer Pages 技术的一种Model-View-Controller 的实现。Struts 可以帮助你控制Web 项目中的变化并提高专业化。即使你可能永远不会用Struts实现一个系统,你可以获得一些想法用于你未来的servlet 和JSP 网页的实现中。 简介 在小学校园里的小孩子们都可以在因特网上发布HTML 网页。然而,有一个重大的不同在一个小学生和一个专业人士开发的网站之间。网页设计师(或者HTML开发人员)必须理解颜色、用户、生产流程、网页布局、浏览器兼容性、图像创建、JavaScript 等等。设计漂亮的网站需要做大量的工作,大多数Java 开发人员更注重创建优美的对象接口,而不是用户界面。JavaServer Pages (JSP) 技术为网页设计人员和Java 开发人员提供了一种联系钮带。 如果你开发过大型Web 应用程序,你就理解“变化”这个词语。“模型-视图-控制器”(MVC) 就是用来帮助你控制变化的一种设计模式。MVC 减弱了业务逻辑接口和数据接口之间的耦合。Struts 是一种MVC 实现,它将Servlet 2.2 和JSP 1.1 标记(属于J2EE 规范)用作实现的一部分。你可能永远不会用Struts 实现一个系统,但了解一下Struts 或许使你能将其中的一些思想用于你以后的Servlet和JSP 实现中。 模型-视图-控制器 (MVC) JSP标签只解决了我们问题中的一部分。我们依然有验证、流控制、以及更新应用程序结构的问题。这就是MVC从哪儿来以及来干嘛的。MVC通过把问题分成三类来帮助解决一些与单模块相关的问题:

外文翻译-----JSP简介

JSP Open Category: WEB, JAVA, dynamic pages, the Knowledge Network Contents ? JSP Profile ? JSP technology strength ? JSP technology vulnerable ? JSP six built-in objects: ? JSP dynamic web site development and technology JSP Profile JSP (JavaServer Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*. htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*. jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems. JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy. Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function. JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit.

相关主题
相关文档
最新文档