nvelocity - Velocity: How to make a global array? -


i have 3 vm files: f1.vm, f2.vm , f3.vm in f1.vm make array name protocol_versions:

#set($protocol_versions = [])  

i want add elements in protocol_versions f2.vm file:

#set($success = $protocol_versions.add('{"major":1, "minor":0}')) 

and use protocol_versions array in f3.vm

[ #foreach( $protocolversion in protocol_versions ) { "header": {            "upv": $protocolversion,           }, }  #if(!$foreach.last)  ,  #end #end ] 

i tried unfortunately not initialization. possible ?


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -