Java EE 5

Source: Internet
Author: User
Tags soap web services java web java se

Brief introduction

Java EE Technology is an extension of the Java language platform, enabling developers to create scalable and powerful portable enterprise applications. It defines four kinds of containers for application components: Web, Enterprise JavaBean (EJB), application client, and applet. An application server specification details these containers and the Java APIs they must support, which drives Java EE products to compete with each other while ensuring that applications that conform to this specification can be ported between servers.

The latest version of this platform, Java EE 5, was released in May 2006. Java EE 5 focuses on increasing the productivity of developers, providing a simpler programming model without sacrificing any functionality of the platform. A simpler development model consists primarily of two mechanisms that provide--java annotations and better default behavior. Major functional improvements include improved WEB service support and integration of the JavaServer Faces (JSF) and Java Standard Tag Library (JSTL) in the platform.

This article describes the features in Java EE 5, highlighting changes since the last Java version. (Improvements beyond the scope of this article include StAX api-, a api-that parses XML, and a small degree of improvement across many APIs.) I'll cover four feature categories in general: Web Services, Web applications, enterprise applications, and management and security. Then, to avoid annoying readers, we discuss a small application that uses the Java EE 5 feature to illustrate how the new development model simplifies the development of service-oriented architecture (SOA) WEB applications.

This article assumes that readers are familiar with enterprise-class software systems and want to have a complete picture of Java EE 5. Understanding Java Programming and EE is helpful, but not necessary, for understanding the meaning of features. The discussion of the sample application involves some technical details, and the background of Java EE (or at least the Java-based programming) may be easier to understand.

WEB Services Technology

The annotation (annotation) feature, introduced in Java EE 5, simplifies the development of complex WEB service endpoints and clients, with fewer code and shorter learning processes than previous versions of Java EE. Annotations, first introduced in Java SE 5, are cosmetic code that can be added to code as metadata. They do not directly affect the semantics of the program, but compilers, development tools, and run-time libraries can be processed to generate additional Java-language source files, XML documents, or other artifacts and behaviors that complement the programs that contain annotations. Later in this article, you'll see how to convert a regular Java class to a Web service by adding a simple annotation.

A leap in Web services support

The foundation of WEB service support in Java EE 5 is JAX-WS 2.0, a technology that replaces Jax-RPC 1.1. Both technologies support the creation of restful and SOAP-based Web services without having to deal directly with the inherent XML processing and data binding details of Web services. Developers can continue to use Jax-RPC (which still requires the Java EE 5 container), but it is strongly recommended that you migrate to JAX-WS. Developers who are just starting to learn Java Web services can skip Jax-RPC and use Jax-ws directly. They all support SOAP 1.1 over HTTP 1.1, so they are fully compatible: JAX-WS Web Service clients can access the Jax-RPC Web service endpoint, and vice versa.

Compared with Jax-RPC, JAX-WS has many advantages. JAX-WS:

Supports the SOAP 1.2 standard (and SOAP 1.1).

Supports XML over HTTP. If you prefer, you can not use SOAP.

Use Java architecture for XML Binding (JAXB) as the data mapping model. JAXB fully supports XML schemas and performs better (see below for more information).

Introduced a dynamic programming model for both the client and the server. The client model supports message-oriented and asynchronous methods.

Support for message transmission optimization Mechanism (MTOM), a standard-for-information-for-the-the-a-word for optimizing SOAP messaging and formatting.

Upgraded WEB Services Interoperability (WS-I) support. (It supports basic Profile 1.1;JAX-WS only supports Basic Profile 1.0.) )

The SOAP attachment support has been upgraded. (It supports the Attachments API for Java [SAAJ] 1.3:jax-ws only supports SAAJ 1.2. )

The Wsimport tool in Jax-ws automatically handles many of the details of WEB service development and integrates across platforms into the build process, allowing developers to focus on the application logic that implements or uses the service. It generates various artifacts, including services, service endpoint interfaces (SEI), asynchronous response codes, exceptions based on WSDL errors, and Java classes bound to pattern types through JAXB.

Jax-ws can also improve the performance of WEB services. In the article "Implementing High performance Web Services using JAX-WS 2.0", the Jax-ws-based Web service implementation (using the other two Web service features in Java EE 5-j AXB and StAX) and performance comparisons based on Jax-RPC service implementations in Java EE 1.4. The study found that Jax-ws produced 40% to 1000% performance improvements in various functional areas under different workloads.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.