title: Better way to use Velocity's GenericTools in a Standalone app?
body: <p>I want to use VelocityTool's GenericTools for some standard formatting in a standalone app. e.g. have something like this in my Velocity template to use the GenericTools' NumberTool formatter:</p>
  
  <pre><code>Total: $numberTool.format("#0.00", $totalPnL)
  </code></pre>
  
  <p>How do I associate the above "$numberTool" with the GenericTool NumberTool. Here's my Velocity code:</p>
  
  <pre><code>Velocity.init();
  VelocityContext velocityContext = new VelocityContext();
  Template template = Velocity.getTemplate("example.vm");
  velocityContext.put("totalPnL", 100);
  StringWriter sw = new StringWriter();
  template.merge(velocityContext, sw);
  </code></pre>
  
  <p>Now I know I can do this to get it to work:</p>
  
  <pre><code>velocityContext.put("numberTool", new NumberTool());
  </code></pre>
  
  <p>But is that how I need to add all the GenericTools to my app? Manually and one at a time (e.g. another line for DateTool ... etc)? Isn't there a way to make all the GenericTools exposed to my template with out this? I know there's a "tools.xml" that comes with VelocityTools that has the GenericTools defined. Can I just add that to my app to expose all the tools? If so, how?</p>
  
  <p>thanks,
  David</p>