Class VelocityHelper

java.lang.Object
webwork.view.velocity.VelocityHelper

public class VelocityHelper extends Object
Author:
Hani Suleiman (hani@formicary.net) Date: Nov 15, 2003 Time: 11:21:14 AM
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
    The HTTP request object context key.
    static final String
    The HTTP response object context key.
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.velocity.context.Context
    getContext(javax.servlet.ServletContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
    Get the Velocity Context from the request and response.
    static org.apache.velocity.context.Context
    getContext(javax.servlet.ServletContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Map extraContextParams)
    Get the Velocity Context from the request, response and any additional context parameters.
    static org.apache.velocity.context.Context
    getContextWithoutInit(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Map extraContextParams)
    Get the Velocity Context from the request, response and any additional context parameters.
    static void
    initVelocity(javax.servlet.ServletContext context)
    Hook up Velocity with the WebWork configuration.
    static void
    merge(org.apache.velocity.context.Context context, String templateName, Writer writer)
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • VelocityHelper

      public VelocityHelper()
  • Method Details

    • initVelocity

      public static void initVelocity(javax.servlet.ServletContext context) throws Exception
      Hook up Velocity with the WebWork configuration.
      Throws:
      Exception
    • merge

      public static void merge(org.apache.velocity.context.Context context, String templateName, Writer writer)
    • getContext

      public static org.apache.velocity.context.Context getContext(javax.servlet.ServletContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Get the Velocity Context from the request and response. Additionally, initialize Velocity if WebWork hasn't already initialized it.

      Note: This method should only be used if WebWork is responsible for initializing Velocity. If Velocity's lifecycle is being managed else where, use getContextWithoutInit(ServletRequest, ServletResponse, Map) instead, and only after Velocity has been initialized.

    • getContext

      public static org.apache.velocity.context.Context getContext(javax.servlet.ServletContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Map extraContextParams)
      Get the Velocity Context from the request, response and any additional context parameters. Additionally, initialize Velocity if WebWork hasn't already initialized it.

      Note: This method should only be used if WebWork is responsible for initializing Velocity. If Velocity's lifecycle is being managed else where, use getContextWithoutInit(ServletRequest, ServletResponse, Map) instead, and only after Velocity has been initialized.

    • getContextWithoutInit

      public static org.apache.velocity.context.Context getContextWithoutInit(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Map extraContextParams)
      Get the Velocity Context from the request, response and any additional context parameters.

      Note: This method should only be used if after Velocity has been initialized elsewhere.