I am utilizing a modified VelocityToolboxView (found somwhere here on stackoverflow) to take advantage from the Velocity-Tools 2. in spring 3. It appears enjoy it is setting up well, however when I call the $link tool inside a .vm file I recieve an NPE. Checking with the Velocity-Tools sources I discovered it attempts to configure the tool with request and response in the ValueParser props, but they're null here.

Here the stack:

LinkTool.configure(ValueParser) line: 100   
LinkTool(SafeConfig).configure(Map) line: 113   
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39  
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
Method.invoke(Object, Object...) line: 597  
ToolInfo.invoke(Method, Object, Object) line: 363   
ToolInfo.configure(Object, Map<String,Object>) line: 294    
ToolInfo.create(Map<String,Object>) line: 255   
Toolbox.getFromInfo(String, String, Map<String,Object>) line: 152   
Toolbox.get(String, String, Map<String,Object>) line: 112   
ToolContext.findTool(String) line: 221  
ToolContext.get(String) line: 206   
VelocityContext(AbstractContext).get(String) line: 197  

Once the ValueParser will need the request/response values in the map at this time around, where's this normally injected by whom?

This is actually the view class I personally use:

public class VelocityToolsView extends VelocityToolboxView

  private static ToolContext toolContext;

  protected Context createVelocityContext(@SuppressWarnings("rawtypes") Map model,
      HttpServletRequest request, HttpServletResponse response) throws IOException
    VelocityContext context = new VelocityContext(getToolContext());
    if (model != null)
      Set<Map.Entry<String, Object>> entrySet = model.entrySet();
      for (Map.Entry<String, Object> entry : entrySet)
        context.put(entry.getKey(), entry.getValue());
    return context;

  private ToolContext getToolContext() throws IllegalStateException, IOException
    if (toolContext == null)
      XmlFactoryConfiguration factoryConfiguration = new XmlFactoryConfiguration("Default Tools");
      ToolManager toolManager = new ToolManager();
      toolContext = toolManager.createContext();
    return toolContext;

VelocityToolbox is one thing from ancient occasions which was deprecated five years ago. I'm using this technique to integrate Tools into Spring.