<%import> java.util.Date; java.text.SimpleDateFormat; java.text.DateFormat; <%args> Date currentTime; int count; <%class> private static int iterationCount = 0; private static DateFormat dateFormat = new SimpleDateFormat(); private String formatDate(Date date) { return dateFormat.format(date); } <%for int i = 1; i <= count; ++i %>\ Hello world! The time is <% formatDate(currentTime) %>. This template type has been called <% ++iterationCount %> times.