## org.mortbay.html
Class Page

    java.lang.Object
      org.mortbay.html.Element
          org.mortbay.html.Composite
              org.mortbay.html.Page

Direct Known Subclasses:
  FrameSet

Deprecated. Unless somebody steps forward to update and maintain this package

    public class Page

extends Composite

HTML Page. A HTML Page extends composite with the addition of the HTML Header tags, fields and elements. Furthermore, individual parts of the page may be written or the progressive page be output with flush.

Pages contain parameters and named sections. These are used by derived Page classes that implement a Look and Feel. Page users may add to name sections such as "Margin" or "Footer" and set parameters such as "HelpUrl" without knowledge of how the look and feel will arrange these. To assist with standard look and feel creation Page defines a set of standard names for many common parameters and sections.

If named sections are used, the page constructor or completeSections must add the named section to the page in the appropriate places. If named sections are not added to the page, then they can only be written with an explicit call to write(out,"section",end); Changes in behaviour to section creation and adding, should be controlled via page properties.

Version:
  $Id: Page.java,v 1.5 2004/09/23 02:15:15 gregwilkins Exp $
Author:
  Greg Wilkins
See Also:
  `Composite`

Field Summary
`static String` `Back` Deprecated.
`static String` `BaseUrl` Deprecated.
`static String` `BgColour` Deprecated.
`static String` `Content` Deprecated.
`static String` `ContentSize` Deprecated.
`static String` `FgColour` Deprecated.
`static String` `Footer` Deprecated.
`static String` `FooterSize` Deprecated.
`static String` `Header` Deprecated.
`static String` `HeaderSize` Deprecated.
`static String` `Heading` Deprecated.
`static String` `Help` Deprecated.
`static String` `HighlightColour` Deprecated.
`static String` `Home` Deprecated.
`static String` `LeftMargin` Deprecated.
`static String` `LeftMarginSize` Deprecated.
`static String` `Margin` Deprecated.
`static String` `MarginSize` Deprecated.
`static String` `Next` Deprecated.
`static String` `NoTitle` Deprecated.
`static String` `PageType` Deprecated.
`static String` `Prev` Deprecated.
`protected Hashtable` `properties` Deprecated.
`static String` `Request` Deprecated.
`static String` `Response` Deprecated.
`static String` `RightMargin` Deprecated.
`static String` `RightMarginSize` Deprecated.
`static String` `Section` Deprecated.
`static String` `Target` Deprecated.
`static String` `Title` Deprecated.
`static String` `Up` Deprecated.

Fields inherited from class org.mortbay.html.Composite
`elements, nest`

Fields inherited from class org.mortbay.html.Element
`ALIGN, attributeMap, BGCOLOR, BOTTOM, CENTER, CLASS, COLOR, HEIGHT, ID, LEFT, MIDDLE, noAttributes, RIGHT, SIZE, STYLE, TOP, VALIGN, WIDTH`

Constructor Summary
`Page()` Deprecated.
`Page(String title)` Deprecated.
`Page(String title, String attributes)` Deprecated.

Method Summary
`Page` `addHeader(Object o)` Deprecated. Add element or object to the page header.
`void` `addSection(String section, Composite composite)` Deprecated. Set a composite as a named section and add it to the.
`void` `addTo(String section, Object element)` Deprecated. Add content to a named sections.
`protected void` `completeSections()` Deprecated. This call back is called just before writeHeaders() actually writes the HTML page headers.
`void` `flush(Writer out)` Deprecated.
`FrameSet` `frameSet()` Deprecated. Return the preferred FrameSet to be used with a specialized Page.
`Composite` `getSection(String section)` Deprecated. Get a composite as a named section.
`Dictionary` `properties()` Deprecated. Access the page properties.
`void` `rewind()` Deprecated.
`Page` `setBackGroundColor(String color)` Deprecated. Set page background color.
`Page` `setBackGroundImage(String bg)` Deprecated. Set page background image.
`Page` `setBase(String target, String href)` Deprecated. Set the URL Base for the Page.
`void` `setSection(String section, Composite composite)` Deprecated. Set a composite as a named section.
`Page` `title(String title)` Deprecated. Set page title.
`void` `write(Writer out)` Deprecated. Write the entire page by calling: writeHtmlHead(out) writeBodyTag(out) writeElements(out) writeHtmlEnd(out)
`void` `write(Writer out, String section, boolean endHtml)` Deprecated. Write page section.
`void` `writeBodyTag(Writer out)` Deprecated. Write HTML page body tag.
`void` `writeElements(Writer out)` Deprecated. Write any body elements of the page.
`void` `writeHtmlEnd(Writer out)` Deprecated. Write end BODY and end HTML tags.
`void` `writeHtmlHead(Writer out)` Deprecated. Write HTML page head tags.

Methods inherited from class org.mortbay.html.Composite
`add, contents, nest, replace, reset, setNest, size, unnest`

Methods inherited from class org.mortbay.html.Element
`attribute, attribute, attribute, attributes, attributes, bgColor, bottom, center, color, cssClass, cssID, height, height, height, left, middle, right, setAttributesFrom, size, size, style, top, toString, width, width, width, write, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### Request

    public static final String Request

  Deprecated.
  See Also:
    Constant Field Values

### Response

    public static final String Response

  Deprecated.
  See Also:
    Constant Field Values

### Header

    public static final String Header

  Deprecated.
  See Also:
    Constant Field Values

### Title

    public static final String Title

  Deprecated.
  See Also:
    Constant Field Values

### Section

    public static final String Section

  Deprecated.
  See Also:
    Constant Field Values

### HeaderSize

    public static final String HeaderSize

  Deprecated.
  See Also:
    Constant Field Values

### Footer

    public static final String Footer

  Deprecated.
  See Also:
    Constant Field Values

### FooterSize

    public static final String FooterSize

  Deprecated.
  See Also:
    Constant Field Values

### Content

    public static final String Content

  Deprecated.
  See Also:
    Constant Field Values

### ContentSize

    public static final String ContentSize

  Deprecated.
  See Also:
    Constant Field Values

### Margin

    public static final String Margin

  Deprecated.
  See Also:
    Constant Field Values

### MarginSize

    public static final String MarginSize

  Deprecated.
  See Also:
    Constant Field Values

### LeftMargin

    public static final String LeftMargin

  Deprecated.
  See Also:
    Constant Field Values

### LeftMarginSize

    public static final String LeftMarginSize

  Deprecated.
  See Also:
    Constant Field Values

### RightMargin

    public static final String RightMargin

  Deprecated.
  See Also:
    Constant Field Values

### RightMarginSize

    public static final String RightMarginSize

  Deprecated.
  See Also:
    Constant Field Values

### Help

    public static final String Help

  Deprecated.
  See Also:
    Constant Field Values

### Home

    public static final String Home

  Deprecated.
  See Also:
    Constant Field Values

### Heading

    public static final String Heading

  Deprecated.
  See Also:
    Constant Field Values

### Up

    public static final String Up

  Deprecated.
  See Also:
    Constant Field Values

### Prev

    public static final String Prev

  Deprecated.
  See Also:
    Constant Field Values

### Next

    public static final String Next

  Deprecated.
  See Also:
    Constant Field Values

### Back

    public static final String Back

  Deprecated.
  See Also:
    Constant Field Values

### Target

    public static final String Target

  Deprecated.
  See Also:
    Constant Field Values

### BaseUrl

    public static final String BaseUrl

  Deprecated.
  See Also:
    Constant Field Values

### FgColour

    public static final String FgColour

  Deprecated.
  See Also:
    Constant Field Values

### BgColour

    public static final String BgColour

  Deprecated.
  See Also:
    Constant Field Values

### HighlightColour

    public static final String HighlightColour

  Deprecated.
  See Also:
    Constant Field Values

### PageType

    public static final String PageType

  Deprecated.
  See Also:
    Constant Field Values

### NoTitle

    public static final String NoTitle

  Deprecated.
  See Also:
    Constant Field Values

### properties

    protected Hashtable properties

  Deprecated.

Constructor Detail

### Page

    public Page()

  Deprecated.

### Page

    public Page(String title)

  Deprecated.

### Page

    public Page(String title,
                String attributes)

  Deprecated.

Method Detail

### title

    public Page title(String title)

  Deprecated.
  Set page title.

  Returns:
    This Page (for chained commands)

### addHeader

    public Page addHeader(Object o)

  Deprecated.
  Add element or object to the page header.

  Parameters:
    `o` - The Object to add. If it is a String or Element, it is added directly, otherwise toString() is called.
  Returns:
    This Page (for chained commands)

### setBackGroundImage

    public final Page setBackGroundImage(String bg)

  Deprecated.
  Set page background image.

  Returns:
    This Page (for chained commands)

### setBackGroundColor

    public final Page setBackGroundColor(String color)

  Deprecated.
  Set page background color.

  Returns:
    This Page (for chained commands)

### setBase

    public final Page setBase(String target,
                              String href)

  Deprecated.
  Set the URL Base for the Page.

  Parameters:
    `target` - Default link target, null if none.
    `href` - Default absolute href, null if none.
  Returns:
    This Page (for chained commands)

### write

    public void write(Writer out)
               throws IOException

  Deprecated.
  Write the entire page by calling:
  writeHtmlHead(out)
  writeBodyTag(out)
  writeElements(out)
  writeHtmlEnd(out)

  Overrides:
    `write` in class `Composite`
  Parameters:
    `out` - Writer to write the element to.
  Throws:
    `IOException`

### writeHtmlHead

    public void writeHtmlHead(Writer out)
                       throws IOException

  Deprecated.
  Write HTML page head tags. Write tags <HTML><head> .... </head>

  Throws:
    `IOException`

### writeBodyTag

    public void writeBodyTag(Writer out)
                      throws IOException

  Deprecated.
  Write HTML page body tag. Write tags <BODY page attributes>.

  Throws:
    `IOException`

### writeHtmlEnd

    public void writeHtmlEnd(Writer out)
                      throws IOException

  Deprecated.
  Write end BODY and end HTML tags.

  Throws:
    `IOException`

### writeElements

    public void writeElements(Writer out)
                       throws IOException

  Deprecated.
  Write any body elements of the page.

  Throws:
    `IOException`

### write

    public void write(Writer out,
                      String section,
                      boolean endHtml)
               throws IOException

  Deprecated.
  Write page section. The page is written containing only the named section. If a head and bodyTag have not been written, then they are written before the section. If endHtml is true, the end HTML tag is also written. If the named section is Content and it cannot be found, then the normal page contents are written.

  Throws:
    `IOException`

### flush

    public void flush(Writer out)
               throws IOException

  Deprecated.
  Throws:
    `IOException`

### rewind

    public void rewind()

  Deprecated.

### properties

    public Dictionary properties()

  Deprecated.
  Access the page properties. It is up to a derived Page class to interpret these properties.

### frameSet

    public FrameSet frameSet()

  Deprecated.
  Return the preferred FrameSet to be used with a specialized Page. The Frames will be named after the sections they are to contain. The default implementation returns null

### setSection

    public void setSection(String section,
                           Composite composite)

  Deprecated.
  Set a composite as a named section. Other Page users may. add to the section by calling addTo(). It is up to the section creator to add the section to the page in it appropriate position.

### addSection

    public void addSection(String section,
                           Composite composite)

  Deprecated.
  Set a composite as a named section and add it to the. contents of the page

### getSection

    public Composite getSection(String section)

  Deprecated.
  Get a composite as a named section.

### addTo

    public void addTo(String section,
                      Object element)

  Deprecated.
  Add content to a named sections. If the named section cannot. be found, the content is added to the page.

### completeSections

    protected void completeSections()

  Deprecated.
  This call back is called just before writeHeaders() actually writes the HTML page headers. It can be implemented by a derived Page class to complete a named section after the rest of the Page has been created and appropriate properties set.

Copyright © 2007 Mort Bay Consulting. All Rights Reserved.