Quantcast
Channel: Java mon amour
Viewing all articles
Browse latest Browse all 1124

Velocity and rendering JSONObjects or Java Beans

$
0
0
You can use a Velocity template to render either a JsonNode or its corresponding Java bean,
without changing the velocity template.

Code is available https://github.com/vernetto/velocityjson here (the .wm file location is hardcoded with a Widows machine, sorry!)



and the full code is visible here https://github.com/vernetto/velocityjson/blob/master/src/main/java/com/example/demo/VelocityApplication.java

BEWARE the velocity template is stored under the resources folder

The only funny thing is that in the JsonNode the values retain the ""

Viewing all articles
Browse latest Browse all 1124

Trending Articles