[code lang=“java“]import org.apache.velocity.app.Velocity;
import org.apache.velocity.VelocityContext;
import java.io.StringWriter;
public class StartYourEngines {
public static void main(String[] args) throws Exception {
VelocityContext context = new VelocityContext();
context.put(„args“, args);
String template = „args = #foreach ($arg in $args) $arg #end“;
StringWriter writer = new StringWriter();
Velocity.init();
Velocity.evaluate(context,
writer,
„LOG“, // used for logging
template);
System.out.println(writer.getBuffer());
}
}[/code]
Weitere Infos von java.net oder „a cup of java“.