时间:2021-07-01 10:21:17 帮助过:23人阅读
// 2Create a Context object
VelocityContextcontext = new VelocityContext();
// 3 Addyou data object to this context
context.put("title",null);
// 4Choose a template
Templatetemplate = Velocity.getTemplate("null.vm");
// 5Merge the template and you data to produce the output
StringWritersw = new StringWriter();
BufferedWriterbufferWriter = new BufferedWriter(sw);
template.merge(context,bufferWriter);
bufferWriter.flush();
System.out.println(sw.toString());
null.vm
$title
=====
$!title以上就是velocity第11个应用例子---null处理的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!