Hi.

I'm hoping to extend Velocity to be able to convert a JSON string to a Java Map 
so that template authors can map values in Velocity.

Something like:
# set mappings = JsonToMap ($jsonString)
# set username = $mappings($userid)

I thought I could just write a directive for JsonToMap but directives seem to 
return a string rather than a map.

Alternatively could I add a method in the context somehow? Perhaps I could then 
call something like...

# set username = $jsonString.toMap().get($userid)

Sorry if I've misunderstood something fundamental in velocity. I'm interested 
in receiving some guidance on the best way to do this sort of conversion.

Thanks in advance.
Net Wolf

Reply via email to