That method returns a org.apache.velocity.context.Context.

--------------------------------------------------------------------------
protected Context createVelocityContext(
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
   // Create a ChainedContext instance.
   ChainedContext velocityContext = new ChainedContext(
new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());
   // Load a Velocity Tools toolbox, if necessary.
   if (getToolboxConfigLocation() != null) {
       ToolboxManager toolboxManager = ServletToolboxManager.getInstance(
               getServletContext(), getToolboxConfigLocation());
       Map toolboxContext = toolboxManager.getToolbox(velocityContext);
       velocityContext.setToolbox(toolboxContext);
   }
   return velocityContext;
}
--------------------------------------------------------------------------
Taking a look at the above, can I just do this instead?

protected Context createVelocityContext( Map model, HttpServletRequest request,
       HttpServletResponse response ) throws Exception
{
ViewToolContext velocityContext = new ViewToolContext( getVelocityEngine(),
           request, response, getServletContext() );
   return velocityContext;
}

Looking at the "ViewToolContext" it seems to create the toolbox auto-magically.
Is that so?  Or am I missing something?

Thanks again.


Charlie


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to