J2EE and XML Development
Geared toward experienced developers, this reference demonstrates how Java 2 Platform, Enterprise Edition (J2EE), and XML technologies can be used together to create more robust distributed applications and software systems. The use of XML technology to extend and enhance the capabilities of the J2EE platform is covered in detail.
Discussed are J2EE and XML integration at each layer of an n-tier distributed application model. Design patterns, tradeoffs, and decision criteria are provided in terms of individual XML and J2EE technology combinations.
Hot topics in application integration are also covered, including Web services, architectures, and business partner integration.
User interface development
This chapter
- Demonstrates use of XSLT with Java servlets
- Compares pure J2EE user interface
development with an XML approach
- Shows how to build multidevice and multilocale
- Covers XML web publishing frameworks
Creating a robust presentation layer for your J2EE application is a challenging
endeavor. This is so because the vast majority of J2EE applications are web-based,
also known as "thin-client", applications. In this chapter, we examine
some emerging challenges in J2EE user interface design and discuss ways you
might use XML technology to overcome them.
The remainder of the chapter focuses on overcoming the limitations of the
pure J2EE approach using XSLT technology. First we develop an XSLT-based
presentation layer from scratch. Then we use XSLT from within a web pub-lishing
framework to discover the benefits and drawbacks of using a third
party API.
The goal of this chapter is not to convince you that one architecture or
product is superior to another. We wish only to make you aware of the avail-able
options, see them in action, and understand the positive and negative
aspects of taking each approach.
5.1 Creating a thin-client user interface
In this chapter, we focus almost exclusively on web-based, thin-client distrib-uted
applications. Before diving into the details of overcoming challenges
associated with these types of applications, we should take a moment to dis-cuss
what they are and why building interfaces for them is so difficult.
DEFINITION A thin-client application is one in which the server side is responsi-ble
for generating the user interface views into the application. The client side usually consists only of generic rendering software, e. g., a
web browser.
If you have built web-based applications before, you are no doubt familiar
with the thin-client architecture. Until recently, the burden of generating the
user interface for your application on the server side was not too difficult. Two
relatively recent developments, however, are now making the development
and maintenance of your presentation layer components more challenging.
5.1.1 Serving different types of devices
The first new challenge relates to the ongoing proliferation of web-enabled devices. It seems as though anything that runs on electricity these days now
has a web browser on it. These "smart" devices include cell phones, PDAs, and
refrigerators. (That only sounds like a joke.) The trouble with these smart devices is that they are usually quite dumb, virtually light years behind the cur-rent
version of your favorite computer-based Internet browser. Some under-stand
a subset of the HTML specification, and others require an entirely separate markup language. An example of the latter is the WAP-enabled cell
phone, which requires web pages to be rendered using the Wireless Markup Language (WML).
DEFINITION WML is an XML-based presentation markup language specifically
designed for web browsing on cellular telephones. These phones typically feature small display areas and very limited rendering capa-bilities.
WML arranges content into a deck of cards (pages), each of
which should contain very little data and uncomplicated navigation.
Creating a single, integrated user interface that can render content for various
types of devices is difficult to do using the traditional J2EE (or ASP, or Cold Fusion, etc.) approach. User interface components in these technologies were
not designed to change the entire structure of the generated content based on
the type client requesting it. This means that, in order to serve web browser and cell phone client types from your J2EE web application, you must develop
and maintain two separate presentation layers. One layer would generate an HTML
interface, and the other a WML interface. Some updates to the applica-tion would require updates to both user interfaces. If you think managing two
interfaces is scary, consider supporting three more types of client devices in the
same application.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.