Hi,

I am working with the velocity response writer, and I want to develop a custom velocity tool.
To do so, I have written a JAVA class that looks like that:

   @DefaultKey("mytool")
   public class MyCustomTool {

      public MyCustomTool() {
      }

      public String doit(Object arg) {
        // Do something
        return "something";
      }

   }

Then in order to register my custom tool, I create the property file:

   tools.toolbox = application
   tools.application.mytool = org.my.custom.MyCustomTool

By default, this file is named "velocity.properties" and is located within the "conf" folder, according to [1]. This is set by the velocity response writer in the "v.properties" parameter.

After copying the jar file into the "lib" folder of my solr application, I use my custom tool in
my template by calling:

   $mytool.doit($var)

However, this doesn't do anything: no exception, no processing of the $var variable. It seems
that the custom tool is not loaded.
Would you know what I am doing wrong ?

Thanks

ps: By the way, I am using the 2.0-beta3 of the velocity tools.

[1] http://java.dzone.com/news/quick-look-%E2%80%93-solritas-and-gui?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%253A+javalobby%252Ffrontpage+%28Javalobby+%252F+Java+Zone%29 <http://java.dzone.com/news/quick-look-%E2%80%93-solritas-and-gui?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%253A+javalobby%252Ffrontpage+%28Javalobby+%252F+Java+Zone%29>
--
Campinas Stéphane

Reply via email to