|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.niggle.templates.freemarkerimpl.FreemarkerPage
An implementation of the org.niggle.templates.Page interface that uses the freemarker template library.
| Field Summary | |
protected freemarker.template.SimpleHash |
model
|
protected static java.lang.Class |
recordWrapperClass
|
| Constructor Summary | |
FreemarkerPage(freemarker.template.Template pageTemplate,
java.util.Map root,
java.lang.String contentType)
Creates a new FreemarkerPage. |
|
| Method Summary | |
protected RecordWrapper |
createRecordWrapper(Record rec)
create a wrapper of the appropriate class to wrap the given record, reusing the context info. |
void |
expose(java.lang.String key,
boolean b)
Convenience method really, since all Freemarker scalar variables are strings. |
void |
expose(java.lang.String key,
java.lang.Object item)
expose internal data, publishing it to make it available to a Freemarker Template. |
void |
exposeResourceBundle(java.lang.String lookupName)
expose an instance of java.util.ResourceBundle as a template hash variable |
protected java.util.Locale |
getLocale()
|
static java.lang.Class |
getRecordWrapperClass()
|
void |
outputPage(javax.servlet.http.HttpServletResponse response)
Prepare the cooked HTML, 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. |
static void |
setRecordWrapperClass(java.lang.Class cl)
|
void |
setStatic(boolean isStatic)
sets a technical hint as to whether the page should be cached. |
java.lang.String |
toString()
|
freemarker.template.TemplateModel |
wrap(java.lang.Object val)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected freemarker.template.SimpleHash model
protected static java.lang.Class recordWrapperClass
| Constructor Detail |
public FreemarkerPage(freemarker.template.Template pageTemplate,
java.util.Map root,
java.lang.String contentType)
throws java.io.IOException
pageTemplate - the template to use.| Method Detail |
public void outputPage(javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
outputPage in interface Pageresponse - handle to where the output should go.
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public void expose(java.lang.String key,
java.lang.Object item)
expose in interface Pagekey - name of the field in the templateitem - source of the data to populate the template
public void expose(java.lang.String key,
boolean b)
expose in interface Pagekey - name of the field in the templateb - sets to boolean value according to: b ? "true" : ""public void exposeResourceBundle(java.lang.String lookupName)
Page
exposeResourceBundle in interface Pagepublic static java.lang.Class getRecordWrapperClass()
public static void setRecordWrapperClass(java.lang.Class cl)
protected RecordWrapper createRecordWrapper(Record rec)
public freemarker.template.TemplateModel wrap(java.lang.Object val)
wrap in interface freemarker.template.ObjectWrapperpublic void setStatic(boolean isStatic)
Page
setStatic in interface Page
public void setHeader(java.lang.String param,
java.lang.String value)
Page
setHeader in interface Pageprotected java.util.Locale getLocale()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||