We now take a look at the Web application technology options you
should consider in this chapter. The recommendations are guided by
the demands of reuse, flexibility, and interoperability, and
subsequently are based on the
To read more about mobile technologies, refer to the IBM Redbooks entitled Mobile Commerce Solutions Guide using WebSphere Commerce Suite V5.1 , SG24-6171, and Mobile Applications with IBM WebSphere Everyplace Access Design and Development , SG24-6259-00
Figure 6-1 shows the recommended technologies for Web
Figure 6-1:
Web client technology
model
The clients are "thin clients" with little or no application logic. Applications are managed on the server and downloaded to the requesting clients. The client portions of the applications should be implemented in HTML, dynamic HTML (DHTML), XML, and Java applets.
The selection of client-side technologies used in your design will require consideration for the server side, such as whether to store, or dynamically create, elements for the client side.
The following sections outline some of the possible technologies that you should consider, but remember that your choices may be constrained by the policy of your customer or sponsor. For example, for security reasons, only HTML is allowed in the Web client at some government agencies.
We also touch on some of the current technology choices in the wireless area.
A Web browser is a fundamental component of the Web client. For
PC-based clients, the browser typically incorporates support for
HTML, DHTML, JavaScript, and Java. Some browsers are beginning to
add support for XML as well. Under
As an application designer, you must consider the level of
technology you can assume will be available in the user's browser,
or you can add logic to your application to enable
Cross-browser strategies are required to ensure robust
application development. Although many of these technology choices
are maturing, they continue to be inconsistently supported by the
full range of browser
In the J2EE model, the Web browser plays the role of client
container. The model requires that the container provide a Java
Runtime Environment as defined by the Java 2 Platform, Standard
Edition (J2SE). However, for an e-business application that is to
be accessed by the broadest set of users with varying browser
capabilities, the client is often written in HTML with no other
technologies. On an exception basis, limited use of other
technologies, such as using JavaScript for simple edit checks, can
then be
The emergence of pervasive devices introduces new considerations to your design with regard to the content streams that the device can render and the more limited capabilities of the browser. For example, WAP (Wireless Application Protocol) enabled devices render content sent in WML (Wireless Markup Language).
HTML (HyperText Markup Language) is a document markup language
with support for
The HTML specification defines user interface (UI) elements for
text with various fonts and colors, lists, tables, images, and
forms (text fields, buttons, checkboxes, and radio
Because most Web browsers can display HTML V3.2, this is the lowest common denominator for building the client side of an application. To ensure compatibility, developers should be unit testing pages against a validator tool. Free tools, such as the W3C HTML Validation Service, are available at:
http://validator.w3.org/
DHTML allows a high degree of flexibility in designing and
displaying a user interface. In particular, DHTML includes
Cascading Style Sheets (CSS) that enable different fonts, margins,
and line spacing for various
Another advantage of DHTML is that it
Unfortunately, there are several disadvantages when using DHTML.
The greatest of these is that two different
Due to varying levels of browser support, cross-browser design strategies must be used to ensure appropriate presentation and behavior of DHTML elements. In general, this technology is not recommended unless its features are needed to meet usability requirements.
Cascading Style Sheets (CSS) allow you to define a common look and feel for HTML documents. This specification describes how Web documents are to be presented in print and online.
CSS is defined as a set of rules that are identified by
selectors. When
CSS is defined as level 1 and level 2 specifications. Level 1 was written with HTML in mind, while level 2 was expanded to include general markup styles for XML documents. Developers using CSS should unit test against a validator tool, such as the W3C CSS Validation Service at:
http://
Due to varying levels of browser support, cross-browser design strategies must be used to ensure appropriate presentation and behavior of CSS elements. In general, this technology should be used with great attention to support of specification elements.
JavaScript is a cross-platform object-oriented scripting
language. It has great utility in Web applications because of the
browser and document objects that the language supports.
Client-side JavaScript provides the capability to interact with
HTML forms. You can use JavaScript to validate user input on the
client and help improve the performance of your Web application by
reducing the number of
ECMA, a European standards body, has published a standard
(ECMA-262) that is based on JavaScript (from Netscape) and JScript
(from Microsoft), called ECMAScript. The ECMAScript standard
defines a
To address various client-side requirements, Netscape and Microsoft have extended their implementations of JavaScript in version 1.2 by adding new browser objects. Because Netscape's and Microsoft's extensions are different from each other, any script that uses JavaScript 1.2 extensions must detect the browser being used, and select the correct statements to run.
One caveat is that users can disable JavaScript on the client
browser, but this can be programmatically
The use of JavaScript on the server side of a Web application is not recommended, given the alternatives available with Java. Where your design indicates the value of using JavaScript, for example for simple edit checking, use JavaScript 1.1, which contains the core elements of the ECMAScript standard.
The most flexibility of the user interface (UI) technologies
that can be run in a Web browser is
You can use either the AWT or the Swing classes to build a Java applet. But while designing your applet, you should keep in mind that Swing is supported only by later browser versions.
A Java applet is a program written in Java that is downloaded from the Web server and run on the Web browser. The applet to be run is specified in the HTML page using an APPLET tag:
<APPLET CODEBASE="/mydir" CODE="myapplet.class" width=400 height=100> <PARAM NAME="myParameter" VALUE="myValue"> </APPLET>
For this example, a Java applet called "myapplet" will run. An effective way to send data to an applet is by using the PARAM tag. The applet has access to this parameter data and can easily use it as input to the display logic.
{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %}
Java can also request a new HTML page from the Web application
server. This provides an equivalent function to the HTML FORM
submit function. The advantage is that an applet can load a new
HTML page based upon the obvious (a button being clicked) or the
unique (the editing of a
A characteristic of Java applets is that they seldom consist of
just one class file. On the contrary, a large applet may reference
hundreds of class files. Making a request for each of these class
files individually can tax any server and also tax the network
capacity. However, packaging all of these class files into one file
JavaScript can be used to invoke
A disadvantage of using Java applets for UI generation is that
the required version of Java must be supported by the Web browser.
Thus, when using Java, the UI part of the application will
Using Java plug-ins, you can extend the functionality of your browser to support a particular version of Java. Java plug-ins are part of the Java Runtime Environment (JRE) and they are installed when the JRE is installed on the computer. You can specify certain tags in your Web page, to use a particular JRE. This will download the particular JRE if it is not found on the local computer. This can be done in HTML either through:
The conventional APPLET tag, or
The OBJECT tag instead of the APPLET tag for Internet Explorer or the EMBED tag with the APPLET tag for Netscape.
A second disadvantage of Java applets is that any classes such as widgets and business logic that are not included as part of the Java support in the browser must be loaded from the Web server as they are needed. If these additional classes are large, the initialization of the applet may take from seconds to minutes, depending upon the speed of the connection to the Internet.
Using HTTP tunneling, an applet can call back on the server
without reloading the HTML page. For users who are behind a
Because of the above shortcomings, the use of Java applets is
not recommended in environments where mixed levels and brands of
browsers are present. Small applets may be used in rare cases where
HTML UI elements are insufficient to express the semantics of the
client-side Web application user interface. If it is
XML allows you to specify your own markup language with tags specified in a Document Type Definition (DTD) or XML Schema. Actual content streams are then produced that use this markup. The content streams can be transformed to other content streams by using XSL (Extensible Stylesheet Language), which is based on CSS.
For PC-based browsers, HTML is well established for both document content and formatting. The leading browsers have significant investments in rendering engines based on HTML and a Document Object Model (DOM) based on HTML for manipulation by JavaScript.
XML seems to be evolving to a complementary role for active content within HTML documents for the PC browser environment.
For new devices, such as WAP-enabled phones and voice clients, the data content and formatting is being defined by new XML schema, WML for WAP phone and VoiceXML for voice interfaces.
For most Web application designs, you should focus your attention on the use of XML on the server side.
XHTML (Extended HyperText Markup Language) is an extension to
HTML 4, which supports document types that are XML-based. It is
intended to be used as a language for XML-conforming content as
well as for HTML 4-conforming user
The advantages of XHTML are as
Since XHTML documents are XML conforming, they can be
XHTML documents can be used to traverse either the HTML Document Object Model or the XML Document Object Model.
Some issues with XHTML are:
XHTML documents are not as easy to create as HTML documents because XHTML is validated more strictly than HTML.
HTML is already used so widely that it is difficult for XHTML to
Browser support is not usually an issue since documents can be
created using HTML-compatible XHTML that is
Development tool support for XHTML is also improving. The Page Designer tool in IBM WebSphere Studio Application Developer V5.0, for example, allows visual authoring of XHTML pages.
XHTML Basic is designed for Web clients that do not support the
full set of XHTML features. It is
Some of the common features found in Wireless Markup Language
(WML) and other
Basic text
Basic forms and tables
Hyperlinks
Some HTML 4 features have been found inappropriate for non-desktop devices, so extending and building on XHTML Basic will help to bridge that gap.
XForms is W3C's specification for Web forms that can be used with desktop computers, hand-held devices, etc. The disadvantage of the HTML Web forms is that there is no separation of purpose from presentation. XForms separates the data and logic of a form from its presentation. Also, XForms are device-independent.
XForms uses XML for transporting the data that is displayed on the form and the data that is submitted from the form. HTML is used for the data display.
Currently, the main issue with XForms is that it is still an emerging technology, so browser and server support is not yet standard.