NVelocity.Http.Context
Class ChainedContext

Velocity context implementation specific to the Servlet environment.It provides the following special features:puts the request, response, session, and servlet context objects into the Velocity context for direct access, and keeps them read-onlysupports a read-only toolbox of view toolsauto-searches servlet request attributes, session attributes and servlet context attribues for objectsThe {@link #internalGet(String key)} method implements the following search order for objects:servlet request, servlet response, servlet session, servlet contexttoolboxlocal hashtable of objects (traditional use)servlet request attribues, servlet session attribute, servlet context attributesThe purpose of this class is to make it easy for web designer to work with Java servlet based web applications. They do not need to be concerned with the concepts of request, session or application attributes and the live time of objects in these scopes.Note that the put() method always puts objects into the local hashtable.

Field Summary
string APPLICATION
         Key to the HttpContext application object.
string CONTEXT
         Key to the HttpContext object.
string REQUEST
         Key to the HTTP request object.
string RESPONSE
         Key to the HTTP response object.
string SESSION
         Key to the HTTP session object.

Constructor Summary
ChainedContext(NVelocity.Context.IContext ctx, System.Web.HttpContext httpContext)
         Default constructor.

Property Summary
System.Web.HttpContext HttpContext
        Returns the servlet context.
NVelocity.Http.Context.ToolboxContext Toolbox
        Sets the toolbox of view tools.
NVelocity.Context.IContext VelocityContext
        Returns a reference to the Velocity context (this object).

Properties inherited from class NVelocity.Context.AbstractContext
ChainedContext, Keys

Properties inherited from class NVelocity.Context.InternalContextBase
CurrentResource, CurrentTemplateName, EventCartridge, TemplateNameStack

Method Summary
object InternalGet(string key)
        Looks up and returns the object with the specified key.See the class documentation for more details.

Methods inherited from class NVelocity.VelocityContext
Clone, InternalContainsKey, InternalGetKeys, InternalPut, InternalRemove

Methods inherited from class NVelocity.Context.AbstractContext
ContainsKey, Get, Put, Remove

Methods inherited from class NVelocity.Context.InternalContextBase
AttachEventCartridge, ICacheGet, ICachePut, PopCurrentTemplateName, PushCurrentTemplateName

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


Field Detail

APPLICATION

public string APPLICATION

Key to the HttpContext application object.


CONTEXT

public string CONTEXT

Key to the HttpContext object.


REQUEST

public string REQUEST

Key to the HTTP request object.


RESPONSE

public string RESPONSE

Key to the HTTP response object.


SESSION

public string SESSION

Key to the HTTP session object.

Constructor Detail

ChainedContext

public ChainedContext(NVelocity.Context.IContext ctx,
                      System.Web.HttpContext httpContext)

Default constructor.

Property Detail

HttpContext

public System.Web.HttpContext HttpContext

Returns the servlet context.


Toolbox

public NVelocity.Http.Context.ToolboxContext Toolbox

Sets the toolbox of view tools.

Parameters:
box - toolbox of view tools

VelocityContext

public NVelocity.Context.IContext VelocityContext

Returns a reference to the Velocity context (this object).

Method Detail

InternalGet

public object InternalGet(string key)

Looks up and returns the object with the specified key.See the class documentation for more details.

Parameters:
key - the key of the object requested
Returns:
the requested object or null if not found