Class WebWorkVelocityServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.velocity.servlet.VelocityServlet
webwork.view.velocity.WebWorkVelocityServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class WebWorkVelocityServlet extends org.apache.velocity.servlet.VelocityServlet
Velocity integration servlet. Transfer action properties to Velocity context and use WebWork configuration to supply Velocity with settings.

This allows you to use Velocity templates as views of WebWork actions.

Version:
$Revision: 1.7 $
Author:
Rickard Őberg (rickard@dreambean.com)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected org.apache.commons.logging.Log
     
    protected static final String
     

    Fields inherited from class org.apache.velocity.servlet.VelocityServlet

    CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, INIT_PROPS_KEY, REQUEST, RESPONSE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.velocity.context.Context
    createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Create a context that delegates to the standard context and also allows Velocity to access properties from the ValueStack.
    protected org.apache.velocity.Template
    handleRequest(javax.servlet.http.HttpServletRequest aRequest, javax.servlet.http.HttpServletResponse aResponse, org.apache.velocity.context.Context ctx)
    Get the template to show.
    void
     
    void
    service(javax.servlet.ServletRequest aRequest, javax.servlet.ServletResponse aResponse)
     

    Methods inherited from class org.apache.velocity.servlet.VelocityServlet

    chooseCharacterEncoding, doGet, doPost, doRequest, error, getTemplate, getTemplate, handleRequest, init, initVelocity, loadConfiguration, mergeTemplate, requestCleanup, setContentType

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • WebWorkVelocityServlet

      public WebWorkVelocityServlet()
  • Method Details

    • init

      public void init() throws javax.servlet.ServletException
      Overrides:
      init in class javax.servlet.GenericServlet
      Throws:
      javax.servlet.ServletException
    • service

      public void service(javax.servlet.ServletRequest aRequest, javax.servlet.ServletResponse aResponse) throws javax.servlet.ServletException, IOException
      Specified by:
      service in interface javax.servlet.Servlet
      Overrides:
      service in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • createContext

      protected org.apache.velocity.context.Context createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Create a context that delegates to the standard context and also allows Velocity to access properties from the ValueStack.
      Overrides:
      createContext in class org.apache.velocity.servlet.VelocityServlet
    • handleRequest

      protected org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest aRequest, javax.servlet.http.HttpServletResponse aResponse, org.apache.velocity.context.Context ctx) throws Exception
      Get the template to show.
      Overrides:
      handleRequest in class org.apache.velocity.servlet.VelocityServlet
      Throws:
      Exception