org.niggle.templates
Interface Page

All Known Implementing Classes:
FreemarkerPage, VelocityPage, WebMacroPage

public interface Page

An abstract encapsulation of a page template.

Author:
Jonathan Revusky

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
 void outputPage(javax.servlet.http.HttpServletResponse response)
          Prepare the cooked output, filling in the parameters with data values, and send it to the end user via the servlet's response stream.
 void setHeader(java.lang.String param, java.lang.String value)
          Set a header in the servlet response.
 void setStatic(boolean b)
          sets a technical hint as to whether the page should be cached.
 

Method Detail

outputPage

public void outputPage(javax.servlet.http.HttpServletResponse response)
                throws java.io.IOException
Prepare the cooked output, filling in the parameters with data values, and send it to the end user via the servlet's response stream.

Parameters:
response - handle to where the output should go.
Throws:
java.io.IOException

expose

public void expose(java.lang.String key,
                   java.lang.Object item)
Expose internal data, publishing it to make it available to the page template.

Parameters:
key - name of the field in the template
item - source of the data to populate the template

expose

public void expose(java.lang.String key,
                   boolean b)
Expose internal data, publishing it to make it available to the page Template.

Parameters:
key - name of the field in the template
b - sets to boolean value according to: b ? "true" : ""

exposeResourceBundle

public void exposeResourceBundle(java.lang.String lookupName)
expose an instance of java.util.ResourceBundle as a template hash variable


setStatic

public void setStatic(boolean b)
sets a technical hint as to whether the page should be cached. (By default this is false.)


setHeader

public void setHeader(java.lang.String param,
                      java.lang.String value)
Set a header in the servlet response.