Advanced Systems Design with Java, UML and MDA

Appendix B: Web Application Development Support Package

Overview

This appendix describes the Java classes HtmlPage, HtmlForm, etc, which can be used (particularly in Servlet-based systems) to generate web pages as part of an internet application.

Figure B.1 shows the classes involved and their relationships.


Figure B.1: Classes for HTML generation

HtmlBody

This describes the body of an HTML page, as a sequence of HTML components. A component is added to the end of the body by the add( component : HtmlComponent) method.

HtmlComponent

This is the superclass of all the classes describing HTML elements. It defines a collection of attribute-value pairs which can be altered by the setAttribute( att : String, val : String) method. Such pairs appear as HTML attribute settings att = val in the tag of the HTML component.

The method getHtml() : String returns the ASCII text of the HTML component, which can then be sent to a web browser for display.

HtmlForm

This class describes HTML forms, as a list of HTML components within < form > and < /form > tags. The method and action of the form can be set as attributes using setAttribute.

HtmlHead

This class describes the head tag of an HTML page. The title of the document is supplied as a string parameter in the constructor, eg:

HtmlHead head = new HtmlHead("Add entry");

HtmlInput

Describes an input element such as a text entry field or button for use within a form.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Sucker Rods
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.