Pedro Felix
Pedro Felix

Reputation: 1076

Apache velocity precompiled templates

In the context of Apache's Velocity,

1) Is there any way to, given a template and an "example" context, generate Java classes to merge that template with an instance of the "example" context. The idea is to have "precompiled" templates that use strongly typed contexts.

Thanks

Pedro

Upvotes: 2

Views: 859

Answers (1)

Nathan Bubna
Nathan Bubna

Reputation: 6933

No. There was talk and some half-hearted efforts at precompiled templates 9 or 10 years ago, but those working on it decided it was not worth the effort. Of course, they were looking at it as a performance goal. No one has seen fit to work on that since.

In fact, i'm not aware of a java-based template language that does support pre-compiling. It's generally not worth it, at least performance-wise. But the idea of doing it for strong-typing enforcement is new to me. I'm not sure that's been much considered.

Upvotes: 3

Related Questions