Created
June 2, 2014 16:45
-
-
Save acdcjunior/89eb264236284d0d6935 to your computer and use it in GitHub Desktop.
Example configuration file for velocityTools for Apache Velocity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Notes: | |
- Using this file, the tools are "$dateTool" etc. not "$date" as default -- if needed, change the <key>. | |
- Apparently, this format is deprecated in Velocity Tools 2.0, but still works. I didn't manage to get the new | |
format working (http://velocity.apache.org/tools/devel/config-xml.html) so... | |
--> | |
<toolbox> | |
<xhtml>true</xhtml> | |
<tool> | |
<key>msg</key> | |
<scope>request</scope> | |
<parameter name="bundles" value="mensagens" /> | |
<parameter name="defaultBundle" value="mensagens" /> | |
<parameter name="locale" value="pt_BR" /> | |
<class>org.apache.velocity.tools.generic.ResourceTool</class> | |
</tool> | |
<tool> | |
<key>escapeTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.EscapeTool</class> | |
</tool> | |
<tool> | |
<key>dateTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.DateTool</class> | |
<parameter name="format" value="dd/MM/yyyy" /> | |
</tool> | |
<tool> | |
<key>displayTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.DisplayTool</class> | |
</tool> | |
<tool> | |
<key>mathTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.MathTool</class> | |
</tool> | |
<tool> | |
<key>iterTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.IteratorTool</class> | |
</tool> | |
<tool> | |
<key>sortTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.SortTool</class> | |
</tool> | |
<tool> | |
<key>listTool</key> | |
<scope>application</scope> | |
<class>org.apache.velocity.tools.generic.ListTool</class> | |
</tool> | |
</toolbox> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This could be used by adding the property
toolboxConfigLocation
to theViewResolver
declaration in your application context XML file.