Registry / utility / velocity

velocity

JSON →
library1.6.4javamavenunverified

A general-purpose template engine for Java that can render templates with dynamic content.

<dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.6.4</version> </dependency>
INSTALL
IMPORT
SIG · VELOCITY
V
velocity
utilityjavav1.6.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VelocityEngine
org.apache.velocity.app.VelocityEngine

Initialize Velocity and render a template

import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import java.io.StringWriter; public class Main { public static void main(String[] args) throws Exception { VelocityEngine ve = new VelocityEngine(); ve.init(); Template t = ve.getTemplate("hello.vm"); VelocityContext ctx = new VelocityContext(); ctx.put("name", "World"); StringWriter sw = new StringWriter(); t.merge(ctx, sw); System.out.println(sw.toString()); } }
Debug
Known issues
gotchaVelocity 1.6.4 is quite old; consider using Velocity 2.x for bug fixes and improvements.
fix
Upgrade to org.apache.velocity:velocity-engine-core:2.x.
affects: 1.x
Upgrade
Version history
1.6.4latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
velocity — mvn dependency:get velocity · libregistry