1、外文资料 JavaServer Pages Overview JavaServer Pages (JSP) technology enables Web developers and designers to rapidly develop and easily maintain, information-rich, dynamic Web pages that leverage existing business systems. As part of the Java technology family, JSP technology enables rapid development o
2、f Web-based applications that are platform independent. JSP technology separates the user interface from content generation, enabling designers to change the overall page layout without altering the underlying dynamic content. Benefits for Developers If you are a Web page developer or designer who i
3、s familiar with HTML, you can: Use JSP technology without having to learn the Java language: You can use JSP technology without learning how to write Java scriplets. Although scriptlets are no longer required to generate dynamic content, they are still supported to provide backward compatibility. Ex
4、tend the JSP language: Java tag library developers and designers can extend the JSP language with simple tag handlers, which utilize a new, much simpler and cleaner, tag extension API. This spurs the growing number of pluggable, reusable tag libraries available, which in turn reduces the amount of c
5、ode needed to write powerful Web applications. Easily write and maintain pages: The JavaServer Pages Standard Tag Library(JSTL) expression language is now integrated into JSP technology and has been upgraded to support functions. The expression language can now be used instead of scriptlet expressio
6、ns. JSP Technology and Java Servlets JSP technology uses XML-like tags that encapsulate the logic that generates the content for the page. The application logic can reside in server-based resources (such as JavaBeans component architecture) that the page accesses with these tags. Any and all formatt
7、ing (HTML or XML) tags are passed directly back to the response page. By separating the page logic from its design and display and supporting a reusable component-based design, JSP technology makes it faster and easier than ever to build Web-based applications. JavaServer Pages technology is an exte
8、nsion of theJava Servlet technology. Servlets are platform-independent, server-side modules that fit seamlessly into a Web server framework and can be used to extend the capabilities of a Web server with minimal overhead, maintenance, and support. Unlike other scripting languages, servlets involve n
9、o platform-specific consideration or modifications; they are application components that are downloaded, on demand, to the part of the system that needs them. Together, JSP technology and servlets provide an attractive alternative to other types of dynamic Web scripting/programming by offering: plat
10、form independence; enhanced performance; separation of logic from display; ease of administration; extensibility into the enterprise; and, most importantly, ease of use. Today servlets are a popular choice for building interactive Web applications. Third-party servlet containers are available for Ap
11、ache Web Server, Microsoft IIS, and others. Servlet containers are usually a component of Web and application servers, such as BEA WebLogic Application Server, IBM WebSphere,Sun Java System Web Server, Sun Java System Application Server, and others. Community Background The JSP specification is the
12、product of industry-wide collaboration with industry leaders in the enterprise software and tools markets, led by Sun Microsystems. Sun has made the JSP specification freely available to the developer community, with the goal that every Web server and application server will support the JSP interfac
13、e. JSP pages share the Write Once, Run Anywhere advantages of Java technology. JSP technology is a key component in the Java 2 Platform, Enterprise Edition, Suns highly scalable architecture for enterprise applications. JSP Technology in the Java EE 5 Platform The focus of Java EE 5 has been ease of
14、 development by making use of Java language annotations that were introduced by J2SE 5.0. JSP 2.1 supports this goal by defining annotations for dependency injection on JSP tag handlers and context listeners. Another key concern of the Java EE 5 specification has been the alignment of its webtier te
15、chnologies, namely JavaServer Pages (JSP), JavaServer Faces (JSF), and JavaServer Pages Standard Tag Library (JSTL). The outcome of this alignment effort has been the Unified Expression Language (EL), which integrates the expression languages defined by JSP 2.0 and JSF 1.1. The main key additions to
16、 the Unified EL that came out of tbe alignment work have been: A pluggable API for resolving variable references into Java objects and for resolving the properties applied to these Java objects, Support for deferred expressions, which may be evaluated by a tag handler when needed, unlike their regul
17、ar expression counterparts, which get evaluated immediately when a page is executed and rendered, and Support for lvalue expression, which appear on the left hand side of an assignment operation. When used as an lvalue, an EL expression represents a reference to a data structure, for example: a Java
18、Beans property, that is assigned some user input. The new Unified EL is defined in its own specification document, which is delivered along with the JSP 2.1 specification. Thanks to the Unified EL, JSTL tags, such as the JSTL iteration tags, can now be used with JSF components in an intuitive way. J
19、ava Servlet Technology Overview Servlets are the Java platform technology of choice for extending and enhancing Web servers. Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. And unlike proprietar
20、y server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are server- and platform-independent. This leaves you free to select a best of breed strategy for your servers, platforms, and tools. Servlets have access to the entire family of Java APIs, including the JDBC
21、 API to access enterprise databases. Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection. Today servlets are a popular choice for building interactive Web application
22、s. Third-party servlet containers are available for Apache Web Server, Microsoft IIS, and others. Servlet containers are usually a component of Web and application servers, such as BEA WebLogic Application Server, IBM WebSphere, Sun Java System Web Server, Sun Java System Application Server, and oth
23、ers. You might want to check out the latest information on JavaServer Pages (JSP)technology. JSP technology is an extension of the servlet technology created to support authoring of HTML and XML pages. It makes it easier to combine fixed or static template data with dynamic content. Even if youre co
24、mfortable writing servlets, there are several compelling reasons to investigate JSP technology as a complement to your existing work. JavaBeans JavaBeans technology is the component architecture for the Java 2 Platform, Standard Edition (J2SE). Components (JavaBeans) are reusable software programs t
25、hat you can develop and assemble easily to create sophisticated applications. JavaBeans technology is based on the JavaBeans specification. The Bean Builder The Bean Builder is a simple component assembler that demonstrates the visual construction of applications using component assembly mechanisms.
26、 JavaBeans Activation Framework (JAF) JAF lets you take advantage of standard services to: determine the type of an arbitrary piece of data; encapsulate access to it; discover the operations available on it; and instantiate the appropriate bean to perform the operation(s). The Java 2 Enterprise Edit
27、ion (J2EE) is a standard that defines an environment for the development and deployment of enterprise applications. It reduces the cost and complexity of developing multitier enterprise applications as it provides a multitier distributed application model. In other words, it is inherently distribute
28、d and therefore the various parts of an application can run on different devices. Web applications developed using JavaServer Pages (JSP) may require some interaction with J2EE services. For example, a web-based inventory control system may need to access J2EEs directory services to gain access to a
29、 database. Or you may want to use Enterprise JavaBeans (EJB) in your application. This article presents a brief overview of J2EE, then it shows how to: Describe J2EE services in a Web Deployment Descriptor (web.xml) Reference J2EE services Access and use J2EE services from JSPs Overview of J2EE The J2EE is a standard platform for the development and deployment of enterprise applications. The architecture of J2EE, which is component-based, makes developing enterprise applications easy because business logic is organized into reusable