Expresso 5-6

com.jcorporate.expresso.services.html
Class Page

java.lang.Object
  extended bycom.jcorporate.expresso.services.html.HtmlElement
      extended bycom.jcorporate.expresso.services.html.Page

public class Page
extends HtmlElement

An HTML page - a page element contains all other elements and is what actually gets sent to the client

Version:
$Revision: 1.13 $ $Date: 2004/11/17 20:48:18 $
Author:
Michael Nash

Field Summary
 
Fields inherited from class com.jcorporate.expresso.services.html.HtmlElement
attributes, contents, cSSClass, cSSID
 
Constructor Summary
Page()
          Constructor
Page(String newTitle)
          Constructor Create a new page object with the given title
 
Method Summary
 void add(HtmlElement newElement)
          Add a new element to the page
 void display(HttpServletRequest req, HttpServletResponse res, String charset)
           
protected  void display(PrintWriter out)
          Display the page to the client Once a page is displayed it cannot be displayed again or new element added to it.
 void display(PrintWriter out, int depth)
          Raw display after content type and charset has been set.
 void displayPartial(HttpServletRequest req, HttpServletResponse res, String charset)
           
protected  void displayPartial(PrintWriter out)
          Display a partial page to the client, which can be included in another page such as a jsp page.
 void setBGColor(String newColor)
          Set the background color for the page
 void setDBName(String newDBName)
          Set a db name for this page - if no DB name is specified, "default" is used.
 void setTitle(String newTitle)
          Set a new title for this page
 
Methods inherited from class com.jcorporate.expresso.services.html.HtmlElement
display, finalize, getAttribute, getContentCount, getCSSClass, getName, padWithTabs, setAttribute, setCSSClass, setCSSID, setDisplayed, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Page

public Page()
     throws HtmlException
Constructor

Throws:
HtmlException - If the superclass constructor fails

Page

public Page(String newTitle)
     throws HtmlException
Constructor Create a new page object with the given title

Parameters:
newTitle - Title for the page
Throws:
HtmlException - If the parameter is invalid
Method Detail

add

public void add(HtmlElement newElement)
         throws HtmlException
Add a new element to the page

Overrides:
add in class HtmlElement
Parameters:
newElement - Element to add
Throws:
HtmlException - If the parameter is invalid

display

public void display(HttpServletRequest req,
                    HttpServletResponse res,
                    String charset)
             throws HtmlException
Throws:
HtmlException

display

public void display(PrintWriter out,
                    int depth)
             throws HtmlException
Raw display after content type and charset has been set. Make sure you've done both if you call this direct depth is ignored for a page because depth = 0;

Specified by:
display in class HtmlElement
Parameters:
depth - the number of tabs to indent
out - the output print writer
Throws:
HtmlException - If the element (or it's contents) cannot be displayed

display

protected void display(PrintWriter out)
                throws HtmlException
Display the page to the client Once a page is displayed it cannot be displayed again or new element added to it. This used to be the "public" method, but display(HttpServletRequest, HttpServletResponse, String) should be used now instead.

Parameters:
out - PrintWriter to the client
Throws:
HtmlException - If the page or it's contents cannot be displayed

displayPartial

public void displayPartial(HttpServletRequest req,
                           HttpServletResponse res,
                           String charset)
                    throws HtmlException
Throws:
HtmlException

displayPartial

protected void displayPartial(PrintWriter out)
                       throws HtmlException
Display a partial page to the client, which can be included in another page such as a jsp page. Once a page is displayed it cannot be displayed again or new element added to it. This used to be a public method, but Use displayPartial(HttpServletRequest, HttpServletResponse, String) instead now.

Parameters:
out - PrintWriter to the client
Throws:
HtmlException - If the page or it's contents cannot be displayed

setBGColor

public void setBGColor(String newColor)
                throws HtmlException
Set the background color for the page

Parameters:
newColor - Color for the background of this page
Throws:
HtmlException - If the parameter is invalid

setDBName

public void setDBName(String newDBName)
Set a db name for this page - if no DB name is specified, "default" is used. This name is used to select the context/db used for reading the setup value ContextPath, which is used to find the path to the stylesheet for this application

Parameters:
newDBName - the new database name

setTitle

public void setTitle(String newTitle)
Set a new title for this page

Parameters:
newTitle - Title for the page

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.