|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.html.WebPage | +--weblogic.html.HtmlPage
Class for HtmlPage objects. The starting point for the generation of HTML with htmlKona is the creation of an HtmlPage object. Set the HEAD portion of the page by calling the getHead() method. Then set attributes of the page, such as background, background color, name, etc., after calling the getBodyElement() method, with methods from the BodyElement class. Finally, call the getBody() method to add htmlKona elements to the body portion of the page. For example:
HtmlPage hp = new HtmlPage(); hp.getHead() .addElement(new TitleElement("Hello World")) .addElement(new LinkHeadElement(LinkHeadElement.relTag, LinkHeadElement.relCopyright, "http://www.weblogic.com/copyright.html")); hp.getBodyElement() .setAttribute(BodyElement.bgColor, HtmlColor.white) .setAttribute(BodyElement.textColor, HtmlColor.navy); hp.getBody() .addElement(MarkupElement.HorizontalRule) .addElement(new StringElement("Hello World!").asBoldElement()) .addElement(MarkupElement.HorizontalRule); hp.output();
The various output() methods in this class are called to generate HTML to an output stream. If the htmlKona program is executed in a batch mode, the output is directed to a given filename. In the case of a CGI invocation, the output occurs to stdout. If the htmlKona page is used for server-side Java, the argument to the output() method will depend upon the output stream specified by the vendor for the server.
HtmlContainer
,
HtmlElement
,
ServletPage
Field Summary | |
static int |
HTML_2
Deprecated. |
static int |
HTML_3
Deprecated. |
static int |
HTML_4
Deprecated. |
static int |
HTML_4T
Deprecated. |
protected java.lang.String |
htmlLevel
Deprecated. |
Fields inherited from class weblogic.html.WebPage |
allow,
codeset,
contentbuf,
contentencoding,
contentlength,
contents,
contenttype,
expires,
lastmodified,
location,
pragma,
referer,
server |
Constructor Summary | |
HtmlPage()
Deprecated. Constructs an HtmlPage object and sets its content type to "text/html". |
|
HtmlPage(Codeset codeset)
Deprecated. Constructs an HtmlPage object of type "text/html" and sets its codeset. |
|
HtmlPage(java.lang.String title)
Deprecated. Use HtmlPage.getHead().addElement() |
Method Summary | |
HtmlPage |
addScript(java.lang.String script)
Deprecated. Use HtmlPage.getHead().addElement() |
HtmlContainer |
getBody()
Deprecated. Returns the HtmlContainer that is the body portion of an HtmlPage. |
BodyElement |
getBodyElement()
Deprecated. Returns the (HtmlContainer) BodyElement for an HtmlPage, which allows you to set attributes for the BODY tag with the BodyElement.setAttribute() method. |
HtmlContainer |
getHead()
Deprecated. Returns the HtmlContainer that is the head portion of an HtmlPage. |
java.lang.String |
getHtmlLevel()
Deprecated. |
java.lang.String |
getTitle()
Deprecated. Gets the title of an HtmlPage. |
void |
output(java.io.OutputStream out)
Deprecated. |
void |
output(java.io.OutputStream out,
int outputbuffersize)
Deprecated. Outputs HTML for an HtmlPage to the specified OutputStream. |
void |
output(java.io.OutputStream out,
int outputbuffersize,
java.lang.String codeset)
Deprecated. |
void |
output(java.io.OutputStream out,
java.lang.String codeset)
Deprecated. Outputs HTML for an HtmlPage to the specified OutputStream. |
void |
outputBody()
Deprecated. Outputs HTML for the body of an HtmlPage to stout. |
void |
outputBody(java.io.OutputStream out)
Deprecated. Outputs HTML for the body of an HtmlPage to the specified DataOutputStream. |
void |
outputHeader()
Deprecated. Outputs HTML for the header of an HtmlPage to stout. |
void |
outputHeader(java.io.OutputStream out)
Deprecated. Outputs HTML for the header of an HtmlPage to the specified DataOutputStream. |
void |
outputTrailer()
Deprecated. Outputs HTML for the trailer of an HtmlPage to stout. |
void |
outputTrailer(java.io.OutputStream out)
Deprecated. Outputs HTML for the trailer of an HtmlPage to the specified DataOutputStream. |
HtmlPage |
resetBody()
Deprecated. Returns a new HtmlContainer that is the body portion of an HtmlPage. |
HtmlPage |
resetHead()
Deprecated. Returns a new HtmlContainer that is the head portion of an HtmlPage. |
HtmlPage |
setALinkColor(java.lang.String color)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
HtmlPage |
setBackground(java.lang.String url)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
HtmlPage |
setBackgroundColor(java.lang.String color)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
static int |
setDefaultBufferSize(int toBe)
Deprecated. |
HtmlPage |
setFrameSetElement(FrameSetElement fs)
Deprecated. Adds a FrameSetElement to an HtmlPage. |
void |
setHtmlLevel(int version)
Deprecated. Sets the HTML version for a page. |
HtmlPage |
setLinkColor(java.lang.String color)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
HtmlPage |
setOnLoad(java.lang.String str)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
HtmlPage |
setOnUnload(java.lang.String str)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
HtmlPage |
setTitle(java.lang.String title)
Deprecated. Use HtmlPage.getHead().addElement() |
HtmlPage |
setVLinkColor(java.lang.String color)
Deprecated. Use HtmlPage.getBodyElement().setAttribute() |
java.lang.String |
toString()
Deprecated. Returns a string representation of an HtmlPage. |
Methods inherited from class weblogic.html.WebPage |
allow,
allow,
contentBuf,
contentBuf,
contentEncoding,
contentEncoding,
contentLength,
contentLength,
contents,
contents,
contentType,
contentType,
expires,
expires,
includeHeader,
lastModified,
lastModified,
location,
location,
output,
output,
pragma,
pragma,
referer,
referer,
server,
server,
setClientPull,
setClientPull,
setCodeset |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int HTML_2
public static final int HTML_3
public static final int HTML_4
public static final int HTML_4T
protected java.lang.String htmlLevel
Constructor Detail |
public HtmlPage()
public HtmlPage(Codeset codeset)
HtmlPage hp = new HtmlPage(new Codeset("SJIS"));
codeset
- A Codeset objectpublic HtmlPage(java.lang.String title)
HtmlPage.getHead().addElement(new TitleElement(title);
Method Detail |
public static int setDefaultBufferSize(int toBe)
toBe
- Size buffer should bepublic void setHtmlLevel(int version)
doctype
- HTML_2, HTML_3, or HTML_4 (default)public java.lang.String getHtmlLevel()
public java.lang.String getTitle()
public HtmlPage setFrameSetElement(FrameSetElement fs)
fs
- FrameSetElementpublic HtmlContainer getBody()
public BodyElement getBodyElement()
public HtmlPage resetBody()
public HtmlContainer getHead()
public HtmlPage resetHead()
public void outputHeader() throws java.io.IOException
public void outputBody() throws java.io.IOException
public void outputTrailer() throws java.io.IOException
public void outputHeader(java.io.OutputStream out) throws java.io.IOException
ostr
- Output streampublic void outputBody(java.io.OutputStream out) throws java.io.IOException
ostr
- Output streampublic void outputTrailer(java.io.OutputStream out) throws java.io.IOException
ostr
- Output streampublic void output(java.io.OutputStream out, java.lang.String codeset) throws java.io.IOException
ostr
- Output streampublic void output(java.io.OutputStream out) throws java.io.IOException
public void output(java.io.OutputStream out, int outputbuffersize) throws java.io.IOException
ostr
- Output streamoutputbuffersize
- Buffered output stream buffer sizepublic void output(java.io.OutputStream out, int outputbuffersize, java.lang.String codeset) throws java.io.IOException
public java.lang.String toString()
public HtmlPage setTitle(java.lang.String title)
getHead().addElement(new TitleElement(title));
public HtmlPage addScript(java.lang.String script)
HtmlPage.getHead().addElement(new ScriptElement());
public HtmlPage setOnLoad(java.lang.String str)
HtmlPage.getBodyElement().setAttribute(BodyElement.onLoadScript, string);
public HtmlPage setOnUnload(java.lang.String str)
HtmlPage.getBodyElement().setAttribute(BodyElement.onUnload, string);
public HtmlPage setBackground(java.lang.String url)
HtmlPage.getBodyElement().setAttribute(BodyElement.backgroundImg, url);
public HtmlPage setLinkColor(java.lang.String color)
HtmlPage.getBodyElement().setAttribute(BodyElement.linkColor, color);
public HtmlPage setALinkColor(java.lang.String color)
HtmlPage.getBodyElement().setAttribute(BodyElement.aLinkColor, color);
public HtmlPage setVLinkColor(java.lang.String color)
HtmlPage.getBodyElement().setAttribute(BodyElement.vLinkColor, color);
public HtmlPage setBackgroundColor(java.lang.String color)
HtmlPage.getBodyElement().setAttribute(BodyElement.bgColor, color);
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs70 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |