Movatterモバイル変換


[0]ホーム

URL:


Document Information

Preface

Part I Introduction

1.  Overview

Java EE Application Model

Distributed Multitiered Applications

Security

Java EE Components

Java EE Clients

Web Clients

Applets

Application Clients

The JavaBeans Component Architecture

Java EE Server Communications

Web Components

Business Components

Enterprise Information System Tier

Java EE Containers

Container Services

Container Types

Web Services Support

XML

SOAP Transport Protocol

WSDL Standard Format

UDDI and ebXML Standard Formats

Java EE Application Assembly and Deployment

Packaging Applications

Development Roles

Java EE Product Provider

Tool Provider

Application Component Provider

Enterprise Bean Developer

Web Component Developer

Application Client Developer

Application Assembler

Application Deployer and Administrator

Java EE 5 APIs

Enterprise JavaBeans Technology

Java Servlet Technology

JavaServer Pages Technology

JavaServer Pages Standard Tag Library

JavaServer Faces

Java Message Service API

Java Transaction API

JavaMail API

JavaBeans Activation Framework

Java API for XML Processing

Java API for XML Web Services (JAX-WS)

Java Architecture for XML Binding (JAXB)

SOAP with Attachments API for Java

Java API for XML Registries

J2EE Connector Architecture

Java Database Connectivity API

Java Persistence API

Java Naming and Directory Interface

Java Authentication and Authorization Service

Simplified Systems Integration

Sun Java System Application Server 9.1

Tools

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  Java Servlet Technology

5.  JavaServer Pages Technology

6.  JavaServer Pages Documents

7.  JavaServer Pages Standard Tag Library

8.  Custom Tags in JSP Pages

9.  Scripting in JSP Pages

10.  JavaServer Faces Technology

11.  Using JavaServer Faces Technology in JSP Pages

12.  Developing with JavaServer Faces Technology

13.  Creating Custom UI Components

14.  Configuring JavaServer Faces Applications

15.  Internationalizing and Localizing Web Applications

Part III Web Services

16.  Building Web Services with JAX-WS

17.  Binding between XML Schema and Java Classes

18.  Streaming API for XML

19.  SOAP with Attachments API for Java

Part IV Enterprise Beans

20.  Enterprise Beans

21.  Getting Started with Enterprise Beans

22.  Session Bean Examples

23.  A Message-Driven Bean Example

Part V Persistence

24.  Introduction to the Java Persistence API

25.  Persistence in the Web Tier

26.  Persistence in the EJB Tier

27.  The Java Persistence Query Language

Part VI Services

28.  Introduction to Security in the Java EE Platform

29.  Securing Java EE Applications

30.  Securing Web Applications

31.  The Java Message Service API

32.  Java EE Examples Using the JMS API

33.  Transactions

34.  Resource Connections

35.  Connector Architecture

Part VII Case Studies

36.  The Coffee Break Application

37.  The Duke's Bank Application

Part VIII Appendixes

A.  Java Encoding Schemes

B.  About the Authors

Index

 

The Java EE 5 Tutorial

Java Coffee Cup logo
PreviousContentsNext

Java EE 5 APIs

Figure 1-7 illustrates the availability of the Java EE 5 platform APIs in eachJava EE container type. The following sections give a brief summary of thetechnologies required by the Java EE platform, and the APIs used in JavaEE applications.

Figure 1-7 Java EE Platform APIs

Diagram of Java EE Platform APIs for the applet, web, EJB, and application client containers.

Enterprise JavaBeans Technology

An Enterprise JavaBeans (EJB) component, orenterprise bean, is a body of code havingfields and methods to implement modules of business logic. You can think ofan enterprise bean as a building block that can be used alone orwith other enterprise beans to execute business logic on the Java EE server.

There are two kinds of enterprise beans: session beans and message-driven beans. Asession bean represents a transient conversation with a client. When the client finishes executing,the session bean and its data are gone. Amessage-driven bean combines featuresof a session bean and a message listener, allowing a business component toreceive messages asynchronously. Commonly, these are Java Message Service (JMS) messages.

In Java EE 5, entity beans have been replaced by Java persistence APIentities. An entity represents persistent data stored in one row of a databasetable. If the client terminates, or if the server shuts down, the persistencemanager ensures that the entity data is saved.

Java Servlet Technology

Java servlet technology lets you define HTTP-specific servlet classes. A servlet class extendsthe capabilities of servers that host applications that are accessed by way ofa request-response programming model. Although servlets can respond to any type of request,they are commonly used to extend the applications hosted by web servers.

JavaServer Pages Technology

JavaServer Pages (JSP) technology lets you put snippets of servlet code directly intoa text-based document. A JSP page is a text-based document that contains twotypes of text: static data (which can be expressed in any text-basedformat such as HTML, WML, and XML) and JSP elements, which determine howthe page constructs dynamic content.

JavaServer Pages Standard Tag Library

The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSPapplications. Instead of mixing tags from numerous vendors in your JSP applications, youemploy a single, standard set of tags. This standardization allows you to deployyour applications on any JSP container that supports JSTL and makes it morelikely that the implementation of the tags is optimized.

JSTL has iterator and conditional tags for handling flow control, tags for manipulatingXML documents, internationalization tags, tags for accessing databases using SQL, and commonly usedfunctions.

JavaServer Faces

JavaServer Faces technology is a user interface framework for building web applications. The maincomponents of JavaServer Faces technology are as follows:

  • A GUI component framework.

  • A flexible model for rendering components in different kinds of HTML or different markup languages and technologies. ARenderer object generates the markup to render the component and converts the data stored in a model object to types that can be represented in a view.

  • A standardRenderKit for generating HTML/4.01 markup.

The following features support the GUI components:

  • Input validation

  • Event handling

  • Data conversion between model objects and components

  • Managed model object creation

  • Page navigation configuration

All this functionality is available using standard Java APIs and XML-based configuration files.

Java Message Service API

The Java Message Service (JMS) API is a messaging standard that allows JavaEE application components to create, send, receive, and read messages. It enables distributedcommunication that is loosely coupled, reliable, and asynchronous.

Java Transaction API

The Java Transaction API (JTA) provides a standard interface for demarcating transactions. TheJava EE architecture provides a default auto commit to handle transaction commits and rollbacks.Anauto commit means that any other applications that are viewing data will seethe updated data after each database read or write operation. However, if yourapplication performs two separate database access operations that depend on each other, youwill want to use the JTA API to demarcate where the entire transaction,including both operations, begins, rolls back, and commits.

JavaMail API

Java EE applications use the JavaMail API to send email notifications. The JavaMail APIhas two parts: an application-level interface used by the application components to sendmail, and a service provider interface. The Java EE platform includes JavaMail witha service provider that allows application components to send Internet mail.

JavaBeans Activation Framework

The JavaBeans Activation Framework (JAF) is included because JavaMail uses it. JAF providesstandard services to determine the type of an arbitrary piece of data, encapsulate accessto it, discover the operations available on it, and create the appropriate JavaBeanscomponent to perform those operations.

Java API for XML Processing

The Java API for XML Processing (JAXP), part of the Java SE platform,supports the processing of XML documents using Document Object Model (DOM), Simple APIfor XML (SAX), and Extensible Stylesheet Language Transformations (XSLT). JAXP enables applications to parseand transform XML documents independent of a particular XML processing implementation.

JAXP also provides namespace support, which lets you work with schemas that mightotherwise have naming conflicts. Designed to be flexible, JAXP lets you use anyXML-compliant parser or XSL processor from within your application and supports the W3Cschema. You can find information on the W3C schema at this URL:http://www.w3.org/XML/Schema.

Java API for XML Web Services (JAX-WS)

The JAX-WS specification provides support for web services that use the JAXB APIfor binding XML data to Java objects. The JAX-WS specification defines client APIs foraccessing web services as well as techniques for implementing web service endpoints. TheWeb Services for J2EE specification describes the deployment of JAX-WS-based services and clients.The EJB and servlet specifications also describe aspects of such deployment. It mustbe possible to deploy JAX-WS-based applications using any of these deployment models.

The JAX-WS specification describes the support for message handlers that can process messagerequests and responses. In general, these message handlers execute in the same containerand with the same privileges and execution context as the JAX-WS client orendpoint component with which they are associated. These message handlers have access tothe same JNDIjava:comp/env namespace as their associated component. Custom serializers and deserializers,if supported, are treated in the same way as message handlers.

Java Architecture for XML Binding (JAXB)

The Java Architecture for XML Binding (JAXB) provides a convenient way to bindan XML schema to a representation in Java language programs. JAXB can beused independently or in combination with JAX-WS, where it provides a standard databinding for web service messages. All Java EE application client containers, web containers, andEJB containers support the JAXB API.

SOAP with Attachments API for Java

The SOAP with Attachments API for Java (SAAJ) is a low-level API onwhich JAX-WS and JAXR depend. SAAJ enables the production and consumption of messagesthat conform to the SOAP 1.1 specification and SOAP with Attachments note. Most developersdo not use the SAAJ API, instead using the higher-level JAX-WS API.

Java API for XML Registries

The Java API for XML Registries (JAXR) lets you access business and general-purpose registriesover the web. JAXR supports the ebXML Registry and Repository standards and theemerging UDDI specifications. By using JAXR, developers can learn a single API andgain access to both of these important registry technologies.

Additionally, businesses can submit material to be shared and search for material thatothers have submitted. Standards groups have developed schemas for particular kinds of XMLdocuments; two businesses might, for example, agree to use the schema for theirindustry’s standard purchase order form. Because the schema is stored in a standardbusiness registry, both parties can use JAXR to access it.

J2EE Connector Architecture

The J2EE Connector architecture is used by tools vendors and system integrators to createresource adapters that support access to enterprise information systems that can be pluggedin to any Java EE product. Aresource adapter is a software componentthat allows Java EE application components to access and interact with the underlyingresource manager of the EIS. Because a resource adapter is specific to itsresource manager, typically there is a different resource adapter for each type ofdatabase or enterprise information system.

The J2EE Connector architecture also provides a performance-oriented, secure, scalable, and message-based transactionalintegration of Java EE-based web services with existing EISs that can be eithersynchronous or asynchronous. Existing applications and EISs integrated through the J2EE Connector architecture intothe Java EE platform can be exposed as XML-based web services byusing JAX-WS and Java EE component models. Thus JAX-WS and the J2EE Connectorarchitecture are complementary technologies for enterprise application integration (EAI) and end-to-end business integration.

Java Database Connectivity API

The Java Database Connectivity (JDBC) API lets you invoke SQL commands from Javaprogramming language methods. You use the JDBC API in an enterprise bean whenyou have a session bean access the database. You can also use theJDBC API from a servlet or a JSP page to access the databasedirectly without going through an enterprise bean.

The JDBC API has two parts: an application-level interface used by the applicationcomponents to access a database, and a service provider interface to attach aJDBC driver to the Java EE platform.

Java Persistence API

The Java Persistence API is a Java standards-based solution for persistence. Persistence usesan object-relational mapping approach to bridge the gap between an object oriented modeland a relational database. Java Persistence consists of three areas:

  • The Java Persistence API

  • The query language

  • Object/relational mapping metadata

Java Naming and Directory Interface

The Java Naming and Directory Interface (JNDI) provides naming and directory functionality, enabling applicationsto access multiple naming and directory services, including existing naming and directory servicessuch as LDAP, NDS, DNS, and NIS. It provides applications with methods forperforming standard directory operations, such as associating attributes with objects and searching forobjects using their attributes. Using JNDI, a Java EE application can store andretrieve any type of named Java object, allowing Java EE applications to coexistwith many legacy applications and systems.

Java EE naming services provide application clients, enterprise beans, and web components withaccess to a JNDI naming environment. Anaming environment allows a component tobe customized without the need to access or change the component’s source code.A container implements the component’s environment and provides it to the component asa JNDInaming context.

A Java EE component can locate its environment naming context using JNDI interfaces.A component can create ajavax.naming.InitialContext object and looks up the environmentnaming context inInitialContext under the namejava:comp/env. A component’s naming environment isstored directly in the environment naming context or in any of its director indirect subcontexts.

A Java EE component can access named system-provided and user-defined objects. The namesof system-provided objects, such as JTAUserTransaction objects, are stored in the environment namingcontext,java:comp/env. The Java EE platform allows a component to name user-defined objects,such as enterprise beans, environment entries, JDBCDataSource objects, and message connections. An objectshould be named within a subcontext of the naming environment according to thetype of the object. For example, enterprise beans are named within the subcontextjava:comp/env/ejb, and JDBCDataSource references in the subcontextjava:comp/env/jdbc.

Java Authentication and Authorization Service

The Java Authentication and Authorization Service (JAAS) provides a way for a Java EEapplication to authenticate and authorize a specific user or group of users torun it.

JAAS is a Java programming language version of the standard Pluggable Authentication Module(PAM) framework, which extends the Java Platform security architecture to support user-based authorization.

Simplified Systems Integration

The Java EE platform is a platform-independent, full systems integration solution that createsan open marketplace in which every vendor can sell to every customer. Sucha marketplace encourages vendors to compete, not by trying to lock customers intotheir technologies but instead by trying to outdo each other in providing productsand services that benefit customers, such as better performance, better tools, or bettercustomer support.

The Java EE 5 APIs enable systems and applications integration through the following:

  • Unified application model across tiers with enterprise beans

  • Simplified request-and-response mechanism with JSP pages and servlets

  • Reliable security model with JAAS

  • XML-based data interchange integration with JAXP, SAAJ, and JAX-WS

  • Simplified interoperability with the J2EE Connector architecture

  • Easy database connectivity with the JDBC API

  • Enterprise application integration with message-driven beans and JMS, JTA, and JNDI

PreviousContentsNext

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.Legal Notices


[8]ページ先頭

©2009-2025 Movatter.jp