com.opensymphony.webwork.views.freemarker
Class FreemarkerServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.opensymphony.webwork.views.freemarker.FreemarkerServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

Deprecated. Please use the FreemarkerResult result type instead

public class FreemarkerServlet
extends HttpServlet

Author:
CameronBraid
See Also:
Serialized Form

Field Summary
protected  freemarker.template.Configuration configuration
          Deprecated.  
 
Constructor Summary
FreemarkerServlet()
          Deprecated.  
 
Method Summary
protected  freemarker.template.Configuration createConfiguration()
          Deprecated.  
protected  freemarker.template.TemplateModel createModel(freemarker.template.ObjectWrapper wrapper, ServletContext servletContext, HttpServletRequest request, HttpServletResponse response)
          Deprecated.  
protected  Locale deduceLocale(String templatePath, HttpServletRequest request, HttpServletResponse response)
          Deprecated. Returns the locale used for the Configuration.getTemplate(String, Locale) call.
 void doGet(HttpServletRequest request, HttpServletResponse response)
          Deprecated.  
 void doPost(HttpServletRequest request, HttpServletResponse response)
          Deprecated.  
protected  freemarker.template.ObjectWrapper getObjectWrapper()
          Deprecated. This method is called from #process(HttpServletRequest, HttpServletResponse) to obtain the FreeMarker object wrapper object that this result will use for adapting objects into template models..
 void init()
          Deprecated.  
protected  void postTemplateProcess(HttpServletRequest request, HttpServletResponse response, freemarker.template.Template template, freemarker.template.TemplateModel data)
          Deprecated. Called after the execution returns from template.process().
protected  boolean preTemplateProcess(HttpServletRequest request, HttpServletResponse response, freemarker.template.Template template, freemarker.template.TemplateModel data)
          Deprecated. Called before the execution is passed to template.process().
protected  String requestUrlToTemplatePath(HttpServletRequest request)
          Deprecated. Maps the request URL to a template path that is passed to Configuration.getTemplate(String, Locale).
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected freemarker.template.Configuration configuration
Deprecated. 
Constructor Detail

FreemarkerServlet

public FreemarkerServlet()
Deprecated. 
Method Detail

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  IOException
Deprecated. 
Throws:
ServletException
IOException

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   IOException
Deprecated. 
Throws:
ServletException
IOException

init

public void init()
          throws ServletException
Deprecated. 
Throws:
ServletException

getObjectWrapper

protected freemarker.template.ObjectWrapper getObjectWrapper()
Deprecated. 
This method is called from #process(HttpServletRequest, HttpServletResponse) 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 @see Configuration#getObjectWrapper()


createConfiguration

protected freemarker.template.Configuration createConfiguration()
                                                         throws freemarker.template.TemplateException
Deprecated. 
Throws:
freemarker.template.TemplateException

createModel

protected freemarker.template.TemplateModel createModel(freemarker.template.ObjectWrapper wrapper,
                                                        ServletContext servletContext,
                                                        HttpServletRequest request,
                                                        HttpServletResponse response)
                                                 throws freemarker.template.TemplateModelException
Deprecated. 
Throws:
freemarker.template.TemplateModelException

deduceLocale

protected Locale deduceLocale(String templatePath,
                              HttpServletRequest request,
                              HttpServletResponse response)
Deprecated. 
Returns the locale used for the Configuration.getTemplate(String, Locale) call. The base implementation simply returns the locale setting of the configuration. Override this method to provide different behaviour, i.e. to use the locale indicated in the request.


postTemplateProcess

protected void postTemplateProcess(HttpServletRequest request,
                                   HttpServletResponse response,
                                   freemarker.template.Template template,
                                   freemarker.template.TemplateModel data)
                            throws ServletException,
                                   IOException
Deprecated. 
Called after the execution returns from template.process(). This is a generic hook you might use in subclasses to perform a specific action after the template is processed. It will be invoked even if the template processing throws an exception. By default does nothing.

Parameters:
request - the actual HTTP request
response - the actual HTTP response
template - the template that was executed
data - the data that was passed to the template
Throws:
ServletException
IOException

preTemplateProcess

protected boolean preTemplateProcess(HttpServletRequest request,
                                     HttpServletResponse response,
                                     freemarker.template.Template template,
                                     freemarker.template.TemplateModel data)
                              throws ServletException,
                                     IOException
Deprecated. 
Called before the execution is passed to template.process(). This is a generic hook you might use in subclasses to perform a specific action before the template is processed. By default does nothing. A typical action to perform here is to inject application-specific objects into the model root

Parameters:
request - the actual HTTP request
response - the actual HTTP response
template - the template that will get executed
data - the data that will be passed to the template
Returns:
true to process the template, false to suppress template processing.
Throws:
ServletException
IOException

requestUrlToTemplatePath

protected String requestUrlToTemplatePath(HttpServletRequest request)
Deprecated. 
Maps the request URL to a template path that is passed to Configuration.getTemplate(String, Locale). You can override it (i.e. to provide advanced rewriting capabilities), but you are strongly encouraged to call the overridden method first, then only modify its return value.

Parameters:
request - the currently processed request
Returns:
a String representing the template path

WebWork Project Page