All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.abc.templates.HtmlWriter
Object responsible for dynamic substitution and output page to browser.
Tags to substitute must start and end with symbol @. Their lenght must be less than 20 characters. Double @ will be interpreted as 1 symbol @. You can not split tags into 2 strings and output it with 2 prints. (See example 3).
Examples: assuming bbbb="" and we did not specify @dddd@
1. print("aaaaa@bbbb@cccc@dddd@ccc"); //less than 20 characters
output: aaaaacccc@dddd@ccc
2. print("aaaaaaaaa@bbbbCCCC"); // no second @ to match the first one
output: aaaaaaaaa@bbbbCCCC
3. print("aaaaaaaaa@bb"); print("bb@cc");
output: aaaaaaaaa@bbbb@cc
4. print("aaaaaaaaa@bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@cccccc"); //more than 20 characters
output: aaaaaaaaa@bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@cccccc
5. print("aaaaaaaaa@@bbbbb"); // two @ replaced by one
output: aaaaaaaaa@bbbbb
public HtmlWriter(HttpServletResponse res, boolean buffered) throws IOException
public HtmlWriter(HttpServletResponse res, boolean buffered, Substitutor subst) throws IOException
public final void addSubstitute(String sName, String sSubstitute)
public final void close() throws IOException
public final void flush() throws IOException
public final int getCharCounter()
public final HttpServletResponse getResponse()
public final void print(byte s[]) throws IOException
public final void print(byte s[], int iFrom, int iLength) throws IOException
public final void print(char b[]) throws IOException
public final void print(byte b) throws IOException
public final void print(char b) throws IOException
public final void print(String s) throws IOException
public final void setContentType(String sContentType)
All Packages Class Hierarchy This Package Previous Next Index