NVelocity.Http
Class NVelocityViewHandler

A servlet to process Velocity templates. This is comparable to the the JspServlet for JSP-based applications.The servlet provides the following features:renders Velocity templatesprovides support for an auto-loaded, configurable toolboxprovides transparent access to the servlet request attributes, servlet session attributes and servlet context attributes by auto-searching themlogs to the logging facility of the servlet APIVelocityViewServlet supports the following configuration parameters in webl.xml:toolboxPath and name of the toolbox configuration file. The path must be relative to the web application root directory. If this parameter is not found, no toolbox is instantiated.org.apache.velocity.propertiesPath and name of the Velocity configuration file. The path must be relative to the web application root directory. If this parameter is not present, Velocity is initialized with default settings.

Fields inherited from class NVelocity.Http.NVelocityHandler
context, pathTranslated, requestType, url

Fields inherited from class NVelocity.Http.HandlerSkeleton
toolboxManager

Constructor Summary
NVelocityViewHandler()
        Initializes a new instance of the NVelocityViewHandler class.

Properties inherited from class NVelocity.Http.NVelocityHandler
IsReusable

Method Summary
NVelocity.Context.IContext CreateContext(System.Web.HttpContext context)
NVelocity.Template HandleRequest(System.Web.HttpContext context, NVelocity.Context.IContext ctx)
        Handle the template processing request.
void Init(System.Web.HttpContext context, string requestType, string url, string pathTranslated)
        Initializes servlet, toolbox and Velocity template engine.
void InitVelocity()
         Initializes Velocity.

Methods inherited from class NVelocity.Http.NVelocityHandler
Error, GetTemplate, GetTemplate, MergeTemplate, ProcessRequest, RequestCleanup, SetContentType

Methods inherited from class NVelocity.Http.HandlerSkeleton
LoadConfiguration, LoadToolbox

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Constructor Detail

NVelocityViewHandler

public NVelocityViewHandler()

Initializes a new instance of the NVelocityViewHandler class.

Method Detail

CreateContext

protected NVelocity.Context.IContext CreateContext(System.Web.HttpContext context)


HandleRequest

protected NVelocity.Template HandleRequest(System.Web.HttpContext context,
                                           NVelocity.Context.IContext ctx)

Handle the template processing request.

Parameters:
request - client request
response - client response
ctx - VelocityContext to fill
Returns:
Velocity Template object or null

Init

public void Init(System.Web.HttpContext context,
                 string requestType,
                 string url,
                 string pathTranslated)

Initializes servlet, toolbox and Velocity template engine.

Parameters:
config - servlet configuation

InitVelocity

protected void InitVelocity()

Initializes Velocity.

Parameters:
config - servlet configuration parameters