|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.dispatcher.StrutsResultSupport
org.apache.struts2.views.freemarker.PortletFreemarkerResult
public class PortletFreemarkerResult
Field Summary | |
---|---|
protected freemarker.template.Configuration |
configuration
|
protected FreemarkerManager |
freemarkerManager
|
protected ActionInvocation |
invocation
|
protected java.lang.String |
location
|
protected freemarker.template.ObjectWrapper |
wrapper
|
Fields inherited from class org.apache.struts2.dispatcher.StrutsResultSupport |
---|
DEFAULT_PARAM |
Fields inherited from interface org.apache.struts2.portlet.PortletActionConstants |
---|
ACTION_MAPPING, ACTION_PARAM, ACTION_RESET, DEFAULT_ACTION_FOR_MODE, DEFAULT_ACTION_NAME, DEFAULT_DISPATCHER_SERVLET_NAME, DISPATCH_TO, ERROR_ACTION, EVENT_ACTION, EVENT_PHASE, MODE_NAMESPACE_MAP, MODE_PARAM, PHASE, PORTLET_CONFIG, PORTLET_NAMESPACE, RENDER_DIRECT_LOCATION, RENDER_PHASE, REQUEST, RESPONSE, STACK_FROM_EVENT_PHASE |
Fields inherited from interface org.apache.struts2.StrutsStatics |
---|
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT |
Constructor Summary | |
---|---|
PortletFreemarkerResult()
|
|
PortletFreemarkerResult(java.lang.String location)
|
Method Summary | |
---|---|
protected freemarker.template.TemplateModel |
createModel()
Build the instance of the ScopesHashModel, including JspTagLib support Objects added to the model are Application - servlet context attributes hash model JspTaglibs - jsp tag lib factory model Request - request attributes hash model Session - session attributes hash model request - the HttpServletRequst object for direct access response - the HttpServletResponse object for direct access stack - the OgnLValueStack instance for direct access ognl - the instance of the OgnlTool action - the action itself exception - optional : the JSP or Servlet exception as per the servlet spec (for JSP Exception pages) struts - instance of the StrutsUtil class |
protected java.util.Locale |
deduceLocale()
Returns the locale used for the Configuration.getTemplate(String, Locale) call. |
void |
doExecute(java.lang.String location,
ActionInvocation invocation)
Execute this result, using the specified template location. |
protected freemarker.template.Configuration |
getConfiguration()
This method is called from doExecute(String, ActionInvocation)
to obtain the FreeMarker configuration object that this result will use
for template loading. |
java.lang.String |
getContentType()
allow parameterization of the contentType the default being text/html |
protected freemarker.template.ObjectWrapper |
getObjectWrapper()
This method is called from doExecute(String, ActionInvocation)
to obtain the FreeMarker object wrapper object that this result will use
for adapting objects into template models. |
protected java.io.Writer |
getWriter()
The default writer writes directly to the response writer. |
protected void |
postTemplateProcess(freemarker.template.Template template,
freemarker.template.TemplateModel data)
the default implementation of postTemplateProcess applies the contentType parameter |
protected boolean |
preTemplateProcess(freemarker.template.Template template,
freemarker.template.TemplateModel model)
Called before the execution is passed to template.process(). |
void |
setContentType(java.lang.String aContentType)
|
void |
setFreemarkerManager(FreemarkerManager mgr)
|
Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport |
---|
conditionalParse, execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ActionInvocation invocation
protected freemarker.template.Configuration configuration
protected freemarker.template.ObjectWrapper wrapper
protected FreemarkerManager freemarkerManager
protected java.lang.String location
Constructor Detail |
---|
public PortletFreemarkerResult()
public PortletFreemarkerResult(java.lang.String location)
Method Detail |
---|
public void setFreemarkerManager(FreemarkerManager mgr)
public void setContentType(java.lang.String aContentType)
public java.lang.String getContentType()
public void doExecute(java.lang.String location, ActionInvocation invocation) throws java.io.IOException, freemarker.template.TemplateException, javax.portlet.PortletException
doExecute
in class StrutsResultSupport
java.io.IOException
freemarker.template.TemplateException
javax.portlet.PortletException
protected freemarker.template.Configuration getConfiguration() throws freemarker.template.TemplateException
doExecute(String, ActionInvocation)
to obtain the FreeMarker configuration object that this result will use
for template loading. This is a hook that allows you to custom-configure
the configuration object in a subclass, or to fetch it from an IoC
container. The default implementation obtains the configuration
from the ConfigurationManager instance.
freemarker.template.TemplateException
protected freemarker.template.ObjectWrapper getObjectWrapper()
doExecute(String, ActionInvocation)
to obtain the FreeMarker object wrapper object that this result will use
for adapting objects into template models. This is a hook that allows you
to custom-configure the wrapper object in a subclass. The default
implementation returns Configurable.getObjectWrapper()
protected java.io.Writer getWriter() throws java.io.IOException
java.io.IOException
protected freemarker.template.TemplateModel createModel() throws freemarker.template.TemplateModelException
freemarker.template.TemplateModelException
protected java.util.Locale deduceLocale()
Configuration.getTemplate(String, Locale)
call. The base
implementation simply returns the locale setting of the configuration.
Override this method to provide different behaviour,
protected void postTemplateProcess(freemarker.template.Template template, freemarker.template.TemplateModel data) throws java.io.IOException
java.io.IOException
protected boolean preTemplateProcess(freemarker.template.Template template, freemarker.template.TemplateModel model) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |