com.revusky.niggle.templates.webmacroimpl
Class WebMacroPage
java.lang.Object
|
+--com.revusky.niggle.templates.webmacroimpl.WebMacroPage
- All Implemented Interfaces:
- Page
- public class WebMacroPage
- extends java.lang.Object
- implements Page
An implementation of the com.revusky.niggle.templates.Page interface
that uses the WebMacro template engine.
- Author:
- Jonathan Revusky
Constructor Summary |
WebMacroPage(org.webmacro.Template template,
org.webmacro.Context context,
java.util.Locale locale,
java.lang.ClassLoader cl)
Creates a new WebMacroPage. |
Method Summary |
void |
expose(java.lang.String key,
boolean b)
Expose internal data, publishing it to make it
available to the page Template. |
void |
expose(java.lang.String key,
java.lang.Object item)
Expose internal data, publishing it to make it
available to the page template. |
void |
exposeResourceBundle(java.lang.String lookupName)
expose an instance of java.util.ResourceBundle
as a template hash variable |
java.util.Locale |
getLocale()
|
void |
outputPage(javax.servlet.http.HttpServletResponse response,
boolean isStatic)
Prepare the cooked output, filling in the parameters
with data values, and send it to the end user
via the servlet's response stream. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
WebMacroPage
public WebMacroPage(org.webmacro.Template template,
org.webmacro.Context context,
java.util.Locale locale,
java.lang.ClassLoader cl)
throws java.io.IOException
- Creates a new WebMacroPage.
- Parameters:
template
- the template to use.context
- the WebMacro contextcl
- The classloader for looking up resources.
outputPage
public void outputPage(javax.servlet.http.HttpServletResponse response,
boolean isStatic)
throws java.io.IOException
- Description copied from interface:
Page
- Prepare the cooked output, filling in the parameters
with data values, and send it to the end user
via the servlet's response stream.
- Specified by:
outputPage
in interface Page
- Following copied from interface:
com.revusky.niggle.templates.Page
- Parameters:
response
- handle to where the output should go.isStatic
- technical hint regarding whether to cache or not.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- the processed HTML as a String
expose
public void expose(java.lang.String key,
java.lang.Object item)
- Description copied from interface:
Page
- Expose internal data, publishing it to make it
available to the page template.
- Specified by:
expose
in interface Page
- Following copied from interface:
com.revusky.niggle.templates.Page
- Parameters:
key
- name of the field in the templateitem
- source of the data to populate the template
expose
public void expose(java.lang.String key,
boolean b)
- Description copied from interface:
Page
- Expose internal data, publishing it to make it
available to the page Template.
- Specified by:
expose
in interface Page
- Following copied from interface:
com.revusky.niggle.templates.Page
- Parameters:
key
- name of the field in the templateb
- sets to boolean value according to: b ? "true" : ""
exposeResourceBundle
public void exposeResourceBundle(java.lang.String lookupName)
- Description copied from interface:
Page
- expose an instance of java.util.ResourceBundle
as a template hash variable
- Specified by:
exposeResourceBundle
in interface Page
getLocale
public java.util.Locale getLocale()