3.1Velocity
3.1Velocity
原理举例说明
原理举例说明
public static void main(String[] args)
throws Exception {
Velocity.init();
VelocityContext context = new
VelocityContext();
context.put("name", “Velocity");
BufferedWriter writer = new
BufferedWriter(new OutputStreamWriter(
System.out));
Template template =
Velocity.getTemplate("src/velocity/hell
o.vm");
template.merge(context, writer);
writer.flush();
writer.close();
}
评论0