public abstract class Template extends Object
| Modifier and Type | Field and Description |
|---|---|
protected javax.servlet.ServletContext |
application |
protected javax.servlet.ServletConfig |
config |
protected Throwable |
exception |
protected javax.servlet.jsp.JspWriter |
out |
protected Template |
page |
protected javax.servlet.jsp.PageContext |
pageContext |
protected javax.servlet.http.HttpServletRequest |
request |
protected javax.servlet.http.HttpServletResponse |
response |
protected javax.servlet.http.HttpSession |
session |
| Constructor and Description |
|---|
Template() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
attribute(String key,
boolean b)
Boolean attribute: write the key if the value is true.
|
protected void |
attribute(String key,
Object v)
Attribute:
If the value is empty, writes just the key,
otherwise key and value, quoted.
|
protected String |
escape(int i)
Escapes an int for html: just convert it to String.
|
protected String |
escape(Object o)
escape for html: < &
Called from generated write().
|
protected String |
escape(String s)
escape for html: < &
Called from generated write().
|
protected String |
quote(Object o)
Quotes a value so that it can be an attribute's value.
|
protected String |
quote(String value)
Quotes a value so that it can be an attribute's value.
|
void |
setPageContext(javax.servlet.jsp.PageContext pc)
The only setter you need to call.
|
protected void |
substitute(String v)
Called for an element with attribute data-substitute=v.
|
abstract void |
write()
This is the method that template must implement.
|
Template |
write(int i)
Writes an int to out.
|
Template |
write(Object o)
Writes an object to out.
|
Template |
write(String s)
Writes a String to out.
|
Template |
writeln()
Write a string to output.
|
Template |
writeln(String s)
Write a string to output.
|
protected javax.servlet.jsp.JspWriter out
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected javax.servlet.http.HttpSession session
protected javax.servlet.jsp.PageContext pageContext
protected javax.servlet.ServletContext application
protected javax.servlet.ServletConfig config
protected Template page
protected Throwable exception
public final void setPageContext(javax.servlet.jsp.PageContext pc)
public abstract void write()
throws Exception
Exception - Java-islands threw an exception.protected final void substitute(String v) throws Exception
IOExceptionExceptionprotected final String quote(Object o)
protected final String quote(String value)
protected final String escape(int i)
protected final void attribute(String key, boolean b) throws IOException
IOExceptionprotected final void attribute(String key, Object v) throws IOException
IOExceptionpublic final Template write(int i) throws IOException
IOExceptionpublic final Template write(Object o) throws IOException
IOExceptionpublic final Template write(String s) throws IOException
IOExceptionpublic final Template writeln() throws IOException
IOExceptionpublic final Template writeln(String s) throws IOException
IOExceptionCopyright © 2017. All rights reserved.