Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Add XML to your J2EE applications

Integrate an XML presentation layer in the J2EE layered architecture

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Today's organizations' rapid moves to e-business bring new demands on defining flexible systems architectures. Systems need to be powerful, scalable, robust, and, most of all, capable of meeting new business demands. With that in mind, although more and more organizations are adopting a multitier, Java 2 Platform, Enterprise Edition (J2EE)-based application server architecture, they rely on HTML for the presentation layer. This prevents them from fully benefiting from the flexibility the distributed, multitier J2EE framework can offer. XML's Web publishing capabilities are key to solving this architectural shortfall.

This article proposes a replacement for the current HTML-based J2EE architecture presentation layer with a dynamic XML content layer. Through a case study, we'll see an XML-aware, open source application server within a fully operational end-to-end solution. At the heart of the case study resides Cocoon, a servlet from Apache that provides a pluggable Java presentation framework used to present XML content in a variety of formats, on demand.

The situation

J2EE defines a standard for developing multitier enterprise applications. J2EE simplifies enterprise applications by basing them on standardized, modular components, by providing a complete set of services (persistence, security, transactions, and so on) to those components, and by handling many details of application behavior declaratively, without complex programming. However, the architecture's presentation layer is primarily HTML-based, thus limiting the target audience largely to Web browsers. Tomorrow's audience will be much broader, what with a variety of new devices about to revolutionize how we send and receive information. As such, it's imperative to decouple content from presentation logic and become independent of our intended audience's devices. XML is the solution.

XML's Web publishing capabilities are possible using XSLT to transform XML documents into other textual documents. These target documents are often XML-based languages themselves (with HTML serving as a notable exception as it is based on SGML). As a metalanguage, XML can also produce other Web languages such as:

  • XHTML (for Web browsers, WebTV, and soon WAP devices)
  • WML (a language for describing two-dimensional graphics in XML)
  • SVG
  • MathML
  • VoxML (for voice)


XSLT can transform an XML document into any one of these target languages. Once we've expressed the solution in terms of XML, we can leverage it using XML's sister technologies to produce powerful, media-aware Web application that will remain invariant to target device changes.

Case study

The case study develops a software application to automate a car rental company's various processes -- reserving, renting, and returning a car. Our objectives: analyze, design, and implement the car rental agency system and build a scalable system capable of targeting multiple end user devices (Web browsers, WAP -- Wireless Application Protocol -- phones, Web TV, and so on).

For simplicity's sake, we'll implement just one use case: reserve car. Other use cases such as modify/cancel reservation, return/rent car, or maintain car could be similarly implemented.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources