[quote]xml toolbox manager has been deprecated[/quote]
XmlFactoryConfiguration xmlFactoryConfiguration = new XmlFactoryConfiguration(true);
xmlFactoryConfiguration.read(VelocityResult.class.getResourceAsStream("/v2/toolbox.xml"));
if(toolbox == null) {
toolbox = new HashMap<String, Object>(16);
}
Collection<ToolboxConfiguration> toolboxes = xmlFactoryConfiguration.getToolboxes();
for(ToolboxConfiguration configure : toolboxes) {
Collection<ToolConfiguration> tools = configure.getTools();
for(ToolConfiguration tool : tools) {
ToolInfo ti = tool.createInfo();
toolbox.put(ti.getKey(), ti.create(null));//初始化toolbox
}
}