使用Velocity基本步骤 1 initialize an engine 2 create a context and put data into it 3 choose a template and merge it Velocity.init(properties) VelocityContext context = new VelocityContext(); context.put("key1", "value1"); context.put("key2", "value2"); Template t = Velocity.getTemplate(templateFile); t.merge(context, writer);