Advanced Systems Design with Java, UML and MDA

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.
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.
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.
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.
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");Describes an input element such as a text entry field or button for use within a form.