The J2EE 1.4 Standard

     

Here are the significant changes incorporated in the J2EE1.4 specification when compared to the previous technology.

Java Servlet 2.4

The Java Servlet 2.4 represents a relatively small upgrade with small enhancements and clarifications to the prior version 2.3. Here are the changes:

  • The deployment descriptor for the servlet 2.4 now uses the XML schema instead of the DTD.

  • New attributes are added in the RequestDispatcher for the forward method.

  • SingleThreadModel interface is deprecated.

  • New methods are added to the ServletRequest interface and the ServletRequestWrapper.

  • The HttpSession.logout method is removed.

  • Servlets now require HTTP/1.1 and J2SE (Java 2 Platform, Standard Edition) 1.3 or higher and can work with J2EE 1.4.

  • New APIs are added to the Request Listener.

JavaServer Pages (JSP) 2.0

Java Server Pages 2.0 introduced the most significant changes to the JSP technology for the ease-of-development with the introduction of the new Expression Language (EL) into the JSP container, defining reusable custom actions using JSP technology, and the use of the Java Server Pages Tag Library (JSTL).

Expression Language was initially defined by the Java Server Pages Standard Tag Library (JSTL) 1.0 specification, but now it is incorporated in the JSP 2.0 specification. The Expression Language uses familiar syntax with $ and {} such as:

 

 ${expr} 

EL is available for use in attribute values in standard and custom tags. In both cases, it is invoked using the construct ${expr} . Expression Language is a simple language based on relational, logical, and arithmetic operations, a set of implicit objects, extensible functions mapping into static methods in a Java class, and available PageContext Attributes.

An expression language makes it possible to easily access application data stored in JavaBeans components .

Example 1:

For nested calls like <%=accountBean.getAccount().getBalance()%> , it is written in EL as ${accountBean.account.balance} .

Example 2:

 

 <c:if test="${bean.number < 3}"> 

The customer number <c:out value="${bean.customerNumber}"/> has 2 accounts.

 

 ...... </c:if> 

Same code using JSP 2.0 can be written as

 

 <c:if test="${bean.number < 3}"> 

The customer number ${bean.customerNumber} has 2 accounts.

The JSP expression language EL allows you to define a function that can be invoked in an expression. Functions are defined using the same mechanisms as custom tags.

To define a function, in a public class the testMethod should be a public static method. JSP also supports a method of inserting dynamic content using custom tags. The JSP pages can generate dynamic content using simple tag syntax instead of Java code. Custom tags are incredibly useful, because they provide further separation of responsibilities between developers (who create the custom tags) and page authors (who use them).

Creating a custom tag requires several steps to connect your JSP code to the business logic of your Java components as compared to simple scriptlets in the JSP. However, custom tags are easier to distribute and reuse.

A custom action is invoked by using a custom tag in a JSP page. A tag library is a collection of custom tags. A tag library descriptor (TLD) file is an XML document that describes the library.

JDBC 3.0

Java Database Connectivity (JDBC) adds features to savepoint interface support, connection pooling, retrieval of auto-generated keys, and cursor support. JDBC has emerged as part of Java 2 Platform, Standard Edition (J2SE), and part of Java Enterprise Edition (J2EE). JDBC 3.0 API has two packages java.sql and javax.sql, both of these are included in J2SE and J2EE.

JDBC can be used to access one or more data sources in a distributed heterogeneous environment. JDBC 3.0 has some more new features such as ability to have multiple open result set objects, passing parameters to CallableStatement objects by name , and retrieval of parameter metadata.

Enterprise Java Beans (EJB) 2.1

The new features of EJB 2.1 include the following:

  • Enhancements to EJB query language (EJB-QL), many new functions are added to this language: ORDER BY, AVG, MIN, MAX, SUM, COUNT, and MOD.

  • Support of Message-Driven Beans (MDBs) for J2EE Connector 1.5: Now accept messages from sources other than JMS.

  • Support for linking of Message Destinations (the same idea as EJB references, resource references).

  • Support for Web services usages within EJB: Stateless session beans can be invoked over SOAP/HTTP. EJB can easily access a Web service using the new service reference.

  • A container managed timer service: A new event-based mechanism for invoking EJBs at specific times.

  • EJB containers must now support the newest specifications: J2SE 1.4, JMS 1.1, JavaMail 1.3, JAF 1.0, JAXP 1.2, JAXR 1.0, and JAX-RPC 1.1.

  • The ejb-jar.xml standard deployment descriptor is now specified with XML schema, rather than DTD.

Java Connector Architecture (JCA) 1.5

The Java Connector Architecture defines the standards that allow J2EE application servers to interact with a back end, which is called an Enterprise Information System (EIS). An EIS generically designates a system that provides some sort of service to a number of clients . Examples of such systems include legacy infrastructures ”such as relational databases or transaction processing monitors ”and Enterprise Resource Planning (ERP) applications. JCA defines a significantly large number of aspects that regulate the interactions between J2EE applications and such systems. Those aspects include system contracts, for use of the Application Server, and client interfaces, for use with the J2EE application developers who intend to create applications that interact with an EIS.

A key idea in the Connector Architecture is the concept of Resource Adapter. The resource adapter is responsible for implementing the system contracts and the client interfaces ”and it is structured so that it can be plugged into any J2EE-compliant application server. Resource adapters are specific to the EIS they provide an interface for ”but any J2EE application server could use a certain resource adapter to interact with a certain EIS. Resource adapters therefore eliminate the need to write code that is specific to an application.

Java Message Service (JMS) 1.1

For this Technology for Developers release, the embedded messaging provider of WebSphere Application Server Version 5 has been removed and is replaced by a default messaging provider that complies with J2EE 1.4. The default messaging provider is also intended as the messaging foundation for a future Web services integration bus technology.

For the default messaging provider, the core messaging functionality is provided by a messaging engine. The messaging engine manages messaging resources and, through destinations associated with the messaging engine, provides a connection point to which applications connect to access messaging resources. A default messaging engine is created automatically at installation time.

Web Services Enhancements in J2EE 1.4

One of the primary goals of the J2EE 1.4 release is to support Web services that are based on SOAP and HTTP. With this release, J2EE technology can be integrated with Web services in a variety of ways. J2EE components (Java Beans and EJBs) can be exposed as Web services. These services can be accessed by clients that are written in the Java programming language or by existing Web service clients that don't take advantage of Java technology. Also J2EE components can act as Web service clients. The new Web Service APIs in J2EE 1.4 are JAX-RPC 1.1, SAAJ 1.2, JAXR 1.0, and Web Services for J2EE 1.1 (JSR 109).

JAX-RPC (Java API for XML-Based RPC)

The objective of the JAX-RPC (Java API for XML-based RPC) specification is to support the development of simple Web services and Web service clients in such a way as to shield developers from the underlying complexity of SOAP communication.

Basically, JAX-RPC is a specification for building Web service providers and requesters. A requester is a client of a Web service. On the surface, JAX-RPC looks like another instantiation of RMI. Essentially, JAX-RPC allows clients to access a Web service as if the Web service was a local object mapped into the client's address space even though the Web service provider could be on the other side of the world.

However, instead of IIOP or JRMP ”as in the RMI world ”in the JAX-RPC world, a remote method invocation is done via the XML-based protocol SOAP 1.1, which typically rides on top of HTTP.

The JAX-RPC Web service can be created either from a Java Bean or from a Session Bean. The Web service provider/developer can specify the remote procedures by defining remote methods in a Java interface. The Web service provider/developer only needs to code one or more classes that implement those methods. The rest of the classes and other artifacts can be generated by the Web service vendor's tools.

SAAJ (SOAP with Attachments API for Java)

SOAP with Attachments API for Java (SAAJ) is used mainly for the SOAP messaging that goes on behind the scenes in JAX-RPC and JAXR implementations . Secondarily, it is an API that developers can use when they choose to write SOAP messaging applications directly rather than using JAX-RPC. The SAAJ API allows you to do XML messaging from the Java platform: By simply making method calls using the SAAJ API, you can create, send, and consume XML messages over the Internet.

JAXR (Java API for XML Registries)

The Java API for XML Registries (JAXR) provides a convenient way to access standard business registries over the Internet. Business registries are often described as electronic yellow pages because they contain listings of businesses and the products or services the businesses offer. JAXR gives developers writing applications in the Java programming language a uniform way to use business registries that are based on open standards (such as ebXML) or industry consortium-led specifications (such as UDDI).

The high-level architecture of JAXR consists of the following parts :

  • A JAXR client, which uses the JAXR API to access a registry via a JAXR provider.

  • A JAXR provider, which implements the RegistryService interface and various interfaces in order to allow a client to access registries.



IBM WebSphere and Lotus Implementing Collaborative Solutions
IBM(R) WebSphere(R) and Lotus: Implementing Collaborative Solutions
ISBN: 0131443305
EAN: 2147483647
Year: 2003
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net