Using Velocity tools in a QuestionForm on Mechanical Turk



I'm writing a QuestionForm XML in order to create HITs for mechanical turk. According to the documentation, velocity templates are supported and can be used in the xml, but I can't get velocity tools to work.


I am able to use variable names that take their input from a test.input file, for example, <Text>$aaa</Text> works if the input file contains the field aaa.


However, I can't use the velocity EscapeTool, so this doesn't work:



#set( $bbb = $esc.url($aaa) )
<Text>$bbb</Text>


In the log file velocity.log I get an error that the RHS of the set command is null. I get the same error if I just do #set( $bbb = $esc ) so this means that the EscapeTool is not recognized.


The EscapeTool documentation here says that this segment should be added to a configuration file:



<tool>
<key>esc</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.EscapeTool</class>
</tool>


But I'm not sure where this configuration file is. If I need to create it, how do I point to it?


No comments:

Post a Comment