ITeye博客

解决xml toolbox manager has been deprecated

lean1252 · 2013-09-23 14:28 · velocity · 编程语言 · Markdown

xml toolbox manager has been deprecated



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
				}
			}


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。