|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.server.servlets.HtmlPage
public class HtmlPage
The HtmlPage class encapsulates the functionality required to prepare an HTML script to display in a browser. This class provides methods to construct various HTML elements such as forms, list boxes, anchor tags and headlines.
Constructor Summary | |
---|---|
HtmlPage()
This is the default constructor for the HtmlPage class. |
|
HtmlPage(java.lang.String title)
This constructor takes a String as an argument which is used to initialize the title of the page. |
Method Summary | |
---|---|
void |
addBreak()
This function inserts a line break into the HTML script. |
void |
addHeadline(int headlineType,
java.lang.String headlineText)
This function inserts a headline tag with the value provided as a parameter to the function, as well as the text to be displayed. |
void |
addHidden(java.lang.String name,
java.lang.String value)
This function inserts a hidden input control tag into the HTML script. |
void |
addInput(java.lang.String type,
java.lang.String name,
java.lang.String value,
java.lang.String size)
This function creates an input element for a form. |
void |
addSubmit(java.lang.String value)
This function adds submit button to a form in an HTML page. |
void |
addText(java.lang.String text)
This function adds a normal text string to the HTML script. |
void |
endForm()
This function adds a closing form HTML tag. |
java.lang.String |
getHtml()
This function returns the HTML script to generate the page as it is currently defined. |
java.lang.String |
getSelect(java.lang.String name,
java.lang.String size,
java.lang.String[] values,
java.lang.String[] text)
This function creates an input element which is called a select list. |
java.lang.String |
quote(java.lang.String s)
This function returns a string which is surrounded by quotes. |
void |
startForm(java.lang.String method,
java.lang.String action)
This function inserts the opening tag for a form into the HTML script. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlPage()
public HtmlPage(java.lang.String title)
String
- the title of the pageMethod Detail |
---|
public void addBreak()
public void addHeadline(int headlineType, java.lang.String headlineText)
int
- the headline typeString
- the headline textpublic void addHidden(java.lang.String name, java.lang.String value)
String
- name of hidden tagString
- value of hidden tagpublic void addInput(java.lang.String type, java.lang.String name, java.lang.String value, java.lang.String size)
String
- the type of form input, i.e. text, radio, checkboxString
- the name of the input elementString
- the value associated with this elementString
- the size of the elementpublic void addSubmit(java.lang.String value)
String
- the text to be displayed on the submit buttonpublic void addText(java.lang.String text)
String
- the text to be displayedpublic void endForm()
public java.lang.String getHtml()
public java.lang.String getSelect(java.lang.String name, java.lang.String size, java.lang.String[] values, java.lang.String[] text)
String
- the name of the select listString
- the size of the select list. If set to
one, this becomes a drop down list box.String
- the values associated with the list boxString
- the text displayed in the list box.public java.lang.String quote(java.lang.String s)
String
- the string to be encapsulated in quotespublic void startForm(java.lang.String method, java.lang.String action)
String
- the method of form submission, either
post or get.String
- the action attribute of the form.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |